Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 62b6b4a1 authored by Spencer Low's avatar Spencer Low
Browse files

adb: win32: get test_adb.py running and passing 100%

* Use posixpath instead of os.path, because os.path uses '\' instead of
'/' when running on Windows.

* tempfile.NamedTemporaryFile() does not work right on Windows because
it holds the file open, preventing other processes from accessing the
same file (https://bugs.python.org/issue14243). To work-around this, use
the mechanical transformation described at
http://stackoverflow.com/questions/15169101/how-to-create-a-temporary-file-that-can-be-read-by-a-subprocess



* Use pipes.quote() to quote path arguments, to prevent C:\foo\bar from
turning into C:foobar.

* Open files in binary mode with "b".

* Fix line-ending test to allow for \r\n on Windows, but to still test
for adbd incorrectly sending \r\n (which is then translated to \r\r\n).

Change-Id: Ib6ba94b919b747a878ba3ab54a4dea0801f76947
Signed-off-by: default avatarSpencer Low <CompareAndSwap@gmail.com>
parent 7c789575
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment