summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/dotest.py
Commit message (Collapse)AuthorAgeFilesLines
* Add --curses shortcut for specifying the curses-based test results formatter.Todd Fiala2015-11-091-1/+5
| | | | | | | This commit closes the following review: http://reviews.llvm.org/D14488 llvm-svn: 252498
* Fix Linux tests after r252348.Chaoren Lin2015-11-061-0/+1
| | | | llvm-svn: 252353
* Python 3 - Port use of string.maketrans and don't use sets.Set.Zachary Turner2015-11-061-2/+4
| | | | | | | | | | `sets.Set` has been deprecated in favor of `set` since 2.6, and `string.maketrans` has to be special cased. In Python 3 there is `str.maketrans`, `bytes.maketrans`, and `bytearray.maketrans` and you have to choose the correct one. So we need to introduce a runtime version check at this site. llvm-svn: 252348
* Another import fix for OS X.Chaoren Lin2015-11-051-1/+1
| | | | llvm-svn: 252230
* Fix OS X tests.Chaoren Lin2015-11-051-1/+1
| | | | llvm-svn: 252218
* Python 3 - Turn on absolute imports, and fix existing imports.Zachary Turner2015-11-051-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Absolute imports were introduced in Python 2.5 as a feature (e.g. from __future__ import absolute_import), and made default in Python 3. When absolute imports are enabled, the import system changes in a couple of ways: 1) The `import foo` syntax will *only* search sys.path. If `foo` isn't in sys.path, it won't be found. Period. Without absolute imports, the import system will also search the same directory that the importing file resides in, so that you can easily import from the same folder. 2) From inside a package, you can use a dot syntax to refer to higher levels of the current package. For example, if you are in the package lldbsuite.test.utility, then ..foo refers to lldbsuite.test.foo. You can use this notation with the `from X import Y` syntax to write intra-package references. For example, using the previous locationa s a starting point, writing `from ..support import seven` would import lldbsuite.support.seven Since this is now the default behavior in Python 3, this means that importing from the same directory with `import foo` *no longer works*. As a result, the only way to have portable code is to force absolute imports for all versions of Python. See PEP 0328 [https://www.python.org/dev/peps/pep-0328/] for more information about absolute and relative imports. Differential Revision: http://reviews.llvm.org/D14342 Reviewed By: Todd Fiala llvm-svn: 252191
* Python 3 - Don't use `os.path.walk`, it's removed in Py3.Zachary Turner2015-11-051-4/+2
| | | | | | | | It was deprecated even in 2.7, but not removed until 3.x. os.walk provides all of the same functionality and is the correct way to do this now. llvm-svn: 252127
* Teach LLDB how to directly launch processes on the iOS simulatorEnrico Granata2015-11-051-4/+34
| | | | | | | | This allows for command-line debugging of iOS simulator binaries (as long as UI is not required, or a full UI simulator has previously been otherwise launched), as well as execution of the LLDB test suite on the iOS simulator This is known to compile on OSX 10.11 GM - feedback from people on other platforms and/or older versions of OSX as to the buildability of this code is greatly appreciated llvm-svn: 252112
* Fix test infrastructure when using xunit output.Todd Fiala2015-11-041-2/+2
| | | | | | Our test reporting infrastructure needed module names to change based on the python package layout. llvm-svn: 252058
* Python 3 - Use universal_newlines when calling subprocess.check_outputZachary Turner2015-11-041-1/+1
| | | | | | | | | | | | | | | | | By default in Python 3, check_output() returns a program's output as an encoded byte sequence. This means it returns a Py3 `bytes` object, which cannot be compared to a string since it's a different fundamental type. Although it might not be correct from a purist standpoint, from a practical one we can assume that all output is encoded in the default locale, in which case using universal_newlines=True will decode it according to the current locale. Anyway, universal_newlines also has the nice behavior that it converts \r\n to \n on Windows platforms so this makes parsing code easier, should we need that. So it seems like a win/win. llvm-svn: 252025
* Remove `use_lldb_suite` from the package, and don't import it anymore.Zachary Turner2015-11-031-1/+1
| | | | | | | | | | | | | | | | This module was originally intended to be imported by top-level scripts to be able to find the LLDB packages and third party libraries. Packages themselves shouldn't need to import it, because by the time it gets into the package, the top-level script should have already done this. Indeed, it was just adding the same values to sys.path multiple times, so this patch is essentially no functional change. To make sure it doesn't get re-introduced, we also delete the `use_lldb_suite` module from `lldbsuite/test`, although the original copy still remains in `lldb/test` llvm-svn: 251963
* Python 3 - Don't use `commands` module anymore.Zachary Turner2015-11-031-5/+5
| | | | | | | | | | The `commands` module was deprecated in 2.7 and removed in 3.x. As a workaround, we introduce a new module `seven` in lldbsuite.support, and write helper functions in there that delegate to the commands module if it is available, and re-implement their functionality for cases where it is not available. llvm-svn: 251959
* Tighten up sys.path, and use absolute imports everywhere.Zachary Turner2015-11-031-6/+1
| | | | | | | | | | | | | | | | | | | | For convenience, we had added the folder that dotest.py was in to sys.path, so that we could easily write things like `import lldbutil` from anywhere and any test. This introduces a subtle problem when using Python's package system, because when unittest2 imports a particular test suite, the test suite is detached from the package. Thus, writing "import lldbutil" from dotest imports it as part of the package, and writing the same line from a test does a fresh import since the importing module was not part of the same package. The real way to fix this is to use absolute imports everywhere. Instead of writing "import lldbutil", we need to write "import lldbsuite.test.util". This patch fixes up that and all other similar cases, and additionally removes the script directory from sys.path to ensure that this can't happen again. llvm-svn: 251886
* Revert "Make new dotest.py executable"Pavel Labath2015-11-021-0/+0
| | | | | | This was a misunderstanding on my part. The new dotest.py is not meant to be executed directly. llvm-svn: 251863
* Revert "Remove the __import__ hack of lldbtest_config."Pavel Labath2015-11-021-2/+5
| | | | | | The hack still seems to be necessary. Putting it back in until we figure out why. llvm-svn: 251862
* Remove the __import__ hack of lldbtest_config.Zachary Turner2015-11-021-5/+2
| | | | | | | | I think the underlying problem was fixed by r251819, but I can't reproduce the problem. So this is to check whether it does in fact fix the problem. llvm-svn: 251822
* Make dosep correctly invoke the top-level script when forking outZachary Turner2015-11-021-3/+2
| | | | | | | | | | | | | | | | | | | | packages/Python/lldbsuite is now a Python package, and it relies on its __init__.py being called to do package-level initialization. If you exec packages/Python/lldbsuite/dotest.py directly, you won't get this package level initialization, and things will fail. But without this patch, this is exactly what dosep itself does. To launch the multi-processing fork, it was hardcoding a path to dotest.py and exec'ing it from inside the package. The fix here is to get the path of the top-level script, and then exec'ing that instead. A more robust solution would involve refactoring the code so that dosep execs some internal script that imports lldbsuite, but that's a bit more involved. Differential Revision: http://reviews.llvm.org/D14157 Reviewed by: Todd Fiala llvm-svn: 251819
* Make new dotest.py executablePavel Labath2015-10-301-0/+0
| | | | llvm-svn: 251684
* Some test cases that need the lldbExec path were failing because lldbExec ↵Enrico Granata2015-10-301-1/+4
| | | | | | | | | | was turning out to be None even though it was being validly set by dotest.py It turns out that lldbtest_config was being imported locally to "lldbsuite.test" instead of globally, so when the test cases got individually brought by a global import via __import__ by unittest2, they did not see the lldbtest_config import, and ended up importing a new separate copy of it, with lldbExec unset This is a simple hackaround that brings lldbtest_config to global visibility and makes sure the configuration data is correctly shared llvm-svn: 251678
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-0/+2039
This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
OpenPOWER on IntegriCloud