I am trying to run the lldb tests with dotest.py but it is failing with
chuckr-mac-build:test chuckr$ python ./dotest.py
Traceback (most recent call last):
File “./dotest.py”, line 30, in
ImportError: No module named progress
It looks like some work was done to move to python 3 and I am using Python 2.7.10. The info at http://lldb.llvm.org/test.html does not seem to be up to date. Is there any fix to get the test script working?
- Python 2.7.10 is still the officially supported way to run tests for all platforms
- Python 3 is only supported for Windows and it’s experimental.
- At some point I will drop support for 2.x on Windows, but 2.x will always be the officially supported way to run tests on every other platform.
Are you running lldb/test/dotest.py or lldb/packages/lldbsuite/test/dotest.py? You should be running the former. The
progress module is located in lldb/third_party/Python/module/progress. That should be in your
sys.path because when you run
lldb/test/dotest.py the first line calls
import use_lldb_suite, which modifies
sys.path to contain this and a few other directories.
Hopefully that gives you a starting point to diagnose what’s wrong.
I was confused because all the tests moved to the packages directory. Do I need to run the dotest.py from the lldb/test/ directory but point it to the individual tests within the packages directory?
You shouldn’t have to point it anywhere. Just run lldb/test/dotest.py the same way you’re currently running it and it should work if you use the right script. That use_lldb_suite also adds the location of the test folder to sys.path so it can find it.
The reason all this happened and everything was moved was to make a “real” python package out of the core of the test suite, which allows lots of functionality to be more easily reused both within the test suite itself, as well as within other scripts that are not part of the test suite.
Should we change the name of lldb/packages/Python/lldbsuite/dotest.py to something else to avoid this confusion?
Yea. And I should also make the if name == “main” check actually work by putting it above the import statements. It’s supposed to print out a message and tell you what to do when you accidentally run that, but it doesn’t get that far because it fails to import a module.