Page MenuHomePhabricator

test infra cleanup: make test_runner/lib into the test_runner package
ClosedPublic

Authored by tfiala on Apr 17 2016, 9:47 PM.

Details

Reviewers
zturner
Summary

Also addresses a PEP8 name violation, converting lldb_utils.OptionalWith to lldb_utils.optional_with.

Diff Detail

Event Timeline

tfiala updated this revision to Diff 54032.Apr 17 2016, 9:47 PM
tfiala retitled this revision from to test infra cleanup: make test_runner/lib into the test_runner package.
tfiala updated this object.
tfiala added reviewers: zturner, labath.
tfiala added a subscriber: lldb-commits.
labath resigned from this revision.Apr 18 2016, 2:43 AM
labath removed a reviewer: labath.

Looks good, but I'll defer to Zachary.

zturner added inline comments.Apr 18 2016, 10:57 AM
packages/Python/lldbsuite/test/test_runner/lldb_utils.py
1 ↗(On Diff #54032)

I feel like this entire file should go under lldbsuite/support. If it's under test/test_runner we can't use it from anything in lldb/scripts, but this is generic enough that there's nothing actually test-specific about it.

tfiala added a subscriber: tfiala.Apr 18 2016, 11:10 AM

Yep, I agree with that now. Wasn't the case when I originally wrote it,
but yeah that can move. I'll adjust that.

tfiala updated this revision to Diff 54115.Apr 18 2016, 2:24 PM

Moves optional_with into its own lldbsuite/support module.

zturner accepted this revision.Apr 18 2016, 2:26 PM
zturner edited edge metadata.

thanks

This revision is now accepted and ready to land.Apr 18 2016, 2:26 PM
tfiala closed this revision.Apr 18 2016, 9:27 PM

Closed via commit:
r266710

commit 4ef9c1c5dcb05a159929cd3b407481ed86a73ef5 (HEAD -> master, origin/master, origin/HEAD)
Author: Todd Fiala <todd.fiala@gmail.com>
Date:   Mon Apr 18 21:20:35 2016

    test infra cleanup: convert test_runner lib into package

    Also does the following:
    * adopts PEP8 naming convention for OptionalWith class (now
      optional_with).
    * moves test_runner/lldb_utils.py to lldbsuite/support/optional_with.py.
    * packages tests in a subpackage of test_runner per recommendations in
      http://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/creation.html

    Tests can be run from within pacakges/Python/lldbsuite/test via this
    command:

      python -m unittest discover test_runner

    The primary cleanup this allows is avoiding the need to muck with the
    PYTHONPATH variable from within the source files.  This also aids some
    of the static code checkers as they don't need to run code to determine
    the proper python path.

    git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@266710 91177308-0d34-0410-b5e6-96231b3b80d8