This is an archive of the discontinued LLVM Phabricator instance.

[TestChangeProcessGroup] Mark the test as xfail for Android API 16
ClosedPublic

Authored by sivachandra on Jun 4 2015, 4:31 PM.

Diff Detail

Event Timeline

sivachandra updated this revision to Diff 27158.Jun 4 2015, 4:31 PM
sivachandra retitled this revision from to [TestChangeProcessGroup] Mark the test as xfail for Android API 16.
sivachandra updated this object.
sivachandra edited the test plan for this revision. (Show Details)
sivachandra added reviewers: labath, chaoren, chying.
sivachandra added a subscriber: Unknown Object (MLST).
chaoren added inline comments.Jun 4 2015, 4:50 PM
test/lldbtest.py
450

Could you specifically check for adb:// scheme? It's conceivable that there could be a device with the name of localhost.

455

I'm not sure if it's possible for getprop to return anything else, but could you try/catch ValueError just in case?

700

int(device_api) seems unnecessary after int(stdout).

701

Just return device_api and (device_api in api_levels)?

Is it necessary to check if device_api is valid? None in list should just return false, right?

labath accepted this revision.Jun 4 2015, 4:57 PM
labath edited edge metadata.

lgtm, with one small comment.

test/lldbtest.py
696

This is missing an else clause.

Also, I think it would be more readable if you inverted the logic here:

if not match:
  return False
...
This revision is now accepted and ready to land.Jun 4 2015, 4:57 PM
sivachandra updated this revision to Diff 27161.Jun 4 2015, 5:01 PM
sivachandra edited edge metadata.

Address comments.

sivachandra added inline comments.Jun 4 2015, 5:03 PM
test/lldbtest.py
450

Done.

455

If int(...) fails, we want it to surface is it not?

700

Done.

701

Done the first part.

For the second part, checking for device_api is an optimization (which really does not matter here I guess) as otherwise the entire list is scanned looking for it even it is None.

sivachandra added inline comments.Jun 4 2015, 5:05 PM
test/lldbtest.py
696

This is the last statement in the function. It will return None if the "if ... " is not hit.

chaoren added inline comments.Jun 4 2015, 5:06 PM
test/lldbtest.py
449

I meant something like:

parsed = urlparse.urlparse(lldb.platform_url)

scheme = parsed.scheme
hostname = parsed.hostname

if scheme == "adb":
    device_id = hostname
labath added inline comments.Jun 4 2015, 5:11 PM
test/lldbtest.py
696

If that is the "python way" then ok, but the c programmer in me does not like it. :)

sivachandra updated this revision to Diff 27163.Jun 4 2015, 5:13 PM

Address comment.

sivachandra added inline comments.Jun 4 2015, 5:15 PM
test/lldbtest.py
449

Ah, this is Android specific so I am not sure that is worth it. However, I have changed it.

Would an assert be more suitable?

assertEqual(scheme, "adb")
chaoren added inline comments.Jun 4 2015, 5:15 PM
test/lldbtest.py
450

You don't need and parsed.hostname != "localhost", the adb:// scheme is adb://device-id:port without ambiguity.

451

s/hostname/parsed.hostname/

sivachandra updated this revision to Diff 27164.Jun 4 2015, 5:22 PM

Fix the "adb" scheme check. Chaoren explained to me offline that the
scheme could be "connect" or "adb"; When its "adb", the hostname is always
the device id. Similarly, if a device id has to be specified in
lldb.platform_url, then the "adb" scheme has to be used.

chaoren accepted this revision.Jun 4 2015, 5:25 PM
chaoren edited edge metadata.

LGTM

sivachandra closed this revision.Jun 4 2015, 5:26 PM
chaoren added inline comments.Jun 4 2015, 5:26 PM
test/lldbtest.py
50

Is python 3 even supported?