summaryrefslogtreecommitdiffstats
path: root/lldb/test/plugins
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-285-170/+0
| | | | | | | | | | | 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
* Python3 - Change `dict.has_key(x)` to `x in dict`Zachary Turner2015-10-261-1/+1
| | | | llvm-svn: 251304
* Python3 - Wrap more statements in calls to list()Zachary Turner2015-10-231-1/+1
| | | | llvm-svn: 251129
* Add from __future__ import print_function everywhere.Zachary Turner2015-10-231-1/+3
| | | | | | | | | | | | | Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
* Run tests with dwo symbol filesTamas Berghammer2015-10-071-0/+11
| | | | | | | | | | dwo symbol files are generated when code compiled with the "-gsplit-dwarf" command option (https://gcc.gnu.org/wiki/DebugFission). This CL modifies the test system to run tests with inferiors compile with the "-gsplit-dwarf" Differential revision: http://reviews.llvm.org/D13300 llvm-svn: 249530
* Append to CFLAGS_EXTRAS and LD_EXTRAS when building cmdline.Robert Flack2015-04-161-1/+7
| | | | | | | | | | | | | | When building the command-line for compilations during tests, append to CFLAGS_EXTRAS and LD_EXTRAS to preserve switches set by the environment (i.e. for cross compiling to test on another platform). Test Plan: TestCPP11EnumTypes.py passes testing from macosx -> linux remotely with cross compiling args in CFLAGS_EXTRAS and LD_EXTRAS. Differential Revision: http://reviews.llvm.org/D8942 llvm-svn: 235083
* Fix makefiles to build shared library tests on Windows.Zachary Turner2015-03-131-3/+3
| | | | | | | | | | | | | | | Abstracted away some POSIX-isms that caused MAKE to issue invalid commands on Windows. Added a new force-include for the test programs so that we can use platform-specific macros. TestSharedLib now builds and cleans up on Windows, though the test still fails some of the expectations. Differential Revision: http://reviews.llvm.org/D8277 Patch by: Adrian McCarthy Issue Tracker: http://llvm.org/pr21727 llvm-svn: 232220
* Make the test runner understand Windows command shell execution.Zachary Turner2014-07-222-49/+28
| | | | | | | | | | | | | | | | Currently, the test runner makes the assumption that it will run commands through /bin/sh. This is obviously not true on Windows, so this patch abstracts this logic out somewhat. Instead of having the caller build the command string himself, the caller will now pass in argument list of the form [[a, b], [c, d], ...] which will get converted into a string of the form a b; c d or a b && c d, depending on the platform. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4590 llvm-svn: 213669
* Fixes a number of issue related to test portability on Windows.Zachary Turner2014-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 99% of this CL is simply moving calls to "import pexpect" to a more narrow scope - i.e. the function that actually runs a particular test. This way the test suite can run on Windows, which doesn't have pexpect, and the individual tests that use pexpect can be disabled on a platform-specific basis. Additionally, this CL fixes a few other cases of non-portability. Notably, using "ps" to get the command line, and os.uname() to determine the architecture don't work on Windows. Finally, this also adds a stubbed out builder_win32 module. The full test suite runs correctly on Windows after this CL, although there is still some work remaining on the C++ side to fix one-shot script commands from LLDB (e.g. script print "foo"), which currently deadlock. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4573 llvm-svn: 213343
* Fix test execution on FreeBSD versions other than 9.xEd Maste2013-07-251-0/+0
| | | | | | | | | | | | | | | The tests use a plugin based on the name from sys.platform. Unfortunately that string includes the major version number in Python 2.7, so the tests would look for builder_freebsd9.py, builder_freebsd10.py, etc. The issue doesn't affect Linux as Python returns 'linux2' also on Linux 3.x -- see http://bugs.python.org/issue12326 for details. It seems later versions of Python will drop the major version number, so adopt this convention now for FreeBSD. llvm-svn: 187121
* Tests require GNU make, called gmake on FreeBSDEd Maste2013-06-241-6/+16
| | | | llvm-svn: 184748
* Update test scripts and Makefiles to allow testing with GCC:Daniel Malea2013-01-251-0/+14
| | | | | | | | | | | - introduce new variable ARCHFLAG in make/Makefile.rules to switch between "-arch" on Mac and "-m" everywhere else - update testcase makefiles to use LD_EXTRAS instead of LDFLAGS (the former interacts with Makefile.rules badly) - special treatment for gcc 4.6: replace "-std=c++11" with "-std=c++0x" as the former is not handled correctly - remove hardcoded "-arch" from test Makefile This patch should not have any effect on lldb on Mac OS X. llvm-svn: 173402
* Fix the wrong comment in TestUUIDMismatchWarnings.py.Johnny Chen2012-08-201-0/+2
| | | | llvm-svn: 162239
* Start working on the test suite in FreeBSDFilipe Cabecinhas2012-08-071-0/+4
| | | | llvm-svn: 161419
* lldb should warn when dSYM does not match the binary.Johnny Chen2012-02-013-21/+41
| | | | | | | | | | | | | | | | | | | o Symbols.cpp: Emit a warning message when dSYM does not match the binary. o warnings/uuid: Added regression test case. o lldbtest.py: Modified to allow test case writer to demand that the build command does not begin with a clean first; required to make TestUUIDMismatchWanring.py work. rdar://problem/10515708 llvm-svn: 149465
* The plugin impl of getCompiler() should be in unison with the Makefile.rules ↵Johnny Chen2011-08-241-1/+1
| | | | | | change. llvm-svn: 138454
* Add a builder module for Linux (plus some refactoring)Peter Collingbourne2011-06-203-14/+22
| | | | llvm-svn: 133457
* Fix some comments.Johnny Chen2011-05-271-2/+2
| | | | llvm-svn: 132232
* Fix another typo.Johnny Chen2011-02-111-1/+1
| | | | llvm-svn: 125323
* Fix a typo.Johnny Chen2011-02-111-1/+1
| | | | llvm-svn: 125322
* Some cleanup to plugins/darwin.py after the recent additions of '-A arch' ↵Johnny Chen2011-01-271-5/+4
| | | | | | | | and '-C compiler' command line options to the test driver. Replace TestBase.getRunSpec() with TestBase.getRunOptions(). llvm-svn: 124353
* Make the string matching for 'frame variable' more stringent with respect toJohnny Chen2010-11-171-0/+4
| | | | | | | | | | | output from clang and llvm-gcc compiled program; both generate the correct debug info with respect to the typedef scoped inside a namespace. Add a TestBase.getCompiler(self) method which returns the compiler in effect the test suite is now running with. Subclasses (like TestNamespace) can use it to distinguish among different compilers. llvm-svn: 119445
* The session log entry containing the command to rerun the same test now also ↵Johnny Chen2010-11-111-0/+5
| | | | | | | | includes the architecture and compiler specs. llvm-svn: 118860
* Some re-achitecturing of the plugins interface. The caller is now required toJohnny Chen2010-10-151-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass in a 'sender' arg to the buildDefault(), buildDsym(), buildDwarf(), and cleanup() functions. The sender arg will be the test instance itself (i.e., an instance of TestBase). This is so that the relevant command execution can be recorded in the TestBase.session object if sender is available. The lldbtest.system() command has been modified to pop the 'sender' arg out of the keyword arguments dictionary and use it as the test instance to facilitate seesion recordings. An example is in test/types/AbstractBase.py: def generic_type_tester(self, atoms, quotedDisplay=False): """Test that variables with basic types are displayed correctly.""" # First, capture the golden output emitted by the oracle, i.e., the # series of printf statements. go = system("./a.out", sender=self) There are cases when sender is None. This is the case when the @classmethod is involved in the use of these APIs. When this happens, there is no recording into a session object, but printing on the sys.stderr is still honored if the trace flag is ON. An example is in test/settings/TestSettings.py: @classmethod def classCleanup(cls): system(["/bin/sh", "-c", "rm -f output.txt"]) system(["/bin/sh", "-c", "rm -f stdout.txt"]) llvm-svn: 116648
* Added the capability for the test driver to relocate the tests and the ↵Johnny Chen2010-10-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | intermediate files to a different top level directory than those specified on the command line. When relocated, the test clanups normally performed afterwards after each test method and after each test class will not be exercised at all. This allows for an easier postmortem analysis of test failures. Example: ./dotest.py -v -t -r /tmp/lldbtest types will create a /tmp/lldbtest directory which houses the types directory and its supported files. Files modified: o dotest.py, lldbtest.py: Add logic to process '-r dir' option to support relocating the tests to a different top level directory instead of exected in place. o darwin.py, test/types/Makefile: The 'make clean' should only clean the minimum .o and .d files. llvm-svn: 116255
* Stop using LLDB_CC/LLDB_ARCH in the plugins for test configurations. Use makeJohnny Chen2010-09-301-4/+4
| | | | | | friendly CC and ARCH, instead. llvm-svn: 115169
* Checked in an initial template for the types directory. Right now, it doesn'tJohnny Chen2010-09-221-16/+35
| | | | | | | | | | | actually test-and-compare anything yet. The lldbtest.TestBase has an added method setTearDownCleanup(dictionary=None) to facilitate running the cleanup right after each data type test is run. The test case can pass a dictionary object when registering the test case cleanup. There is currently only int_type test in the repository. llvm-svn: 114600
* Added the capability to source the configFile specified via the "-c" option inJohnny Chen2010-09-211-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | order to customize the running of the test suite. For the time being, the supported customizations are: o redirecting stdout and/or stderr o specifying a list of compilers to build the test programs o specifying a list of architectures to build the test programs for Also checked into the examples/test directory some example files which demonstrate the usage for the above customizations. $ ./dotest.py -v -c ~/.lldbtest-config persistent_variables $ cat ~/.lldbtest-config sys.stderr = open("/tmp/lldbtest-stderr", "w") sys.stdout = open("/tmp/lldbtest-stdout", "w") compilers = ["gcc", "llvm-gcc"] archs = ["x86_64", "i386"] $ cat /tmp/lldbtest-stderr ---------------------------------------------------------------------- Collected 1 test Configuration: arch=x86_64 compiler=gcc test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase) Test that lldb persistent variables works correctly. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.397s OK Configuration: arch=x86_64 compiler=llvm-gcc test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase) Test that lldb persistent variables works correctly. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.282s OK Configuration: arch=i386 compiler=gcc test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase) Test that lldb persistent variables works correctly. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.297s OK Configuration: arch=i386 compiler=llvm-gcc test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase) Test that lldb persistent variables works correctly. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.269s OK $ cat /tmp/lldbtest-stdout $ llvm-svn: 114380
* Provided a mechanism for the test class to cleanup after itself once it's done.Johnny Chen2010-09-161-0/+8
| | | | | | | | | | | | | | | | | | | | This will remove the confusion experienced when previous test runs left some files (both intermediate or by-product as a result of the test). lldbtest.TestBase defines a classmethod tearDownClass(cls) which invokes the platform-specific cleanup() function as defined by the plugin; after that, it invokes a subclass-specific function classCleanup(cls) if defined; and, finally, it restores the old working directory. An example of classCleanup(cls) is in settings/TestSettings.py: @classmethod def classCleanup(cls): system(["/bin/sh", "-c", "rm output.txt"]) where it deletes the by-product "output.txt" as a result of running a.out. llvm-svn: 114058
* Extend the build mechanism to allow for specifying the compiler used to buildJohnny Chen2010-09-131-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the binaries. If the build* function is passed the compiler argument, for example, 'llvm-gcc', it is passed as a make variable to the make command. Otherwise, we check the LLDB_CC environment variable; if it is defined, it is passed as a make variable to the make command. If neither the compiler keyword argument nor the LLDB_CC environment variable is specified, no CC make variable is passed to the make command. The Makefile gets to define the default CC being used. -------------------------------------------------------------------------------- Example usage follows: o Via the keyword argument: class ArrayTypesTestCase(TestBase): mydir = "array_types" @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") def test_with_dsym_and_run_command(self): """Test 'frame variable var_name' on some variables with array types.""" self.buildDsym(compiler='llvm-gcc') self.array_types() ... o Via LLDB_CC environment variable: $ LLDB_CC=llvm-gcc ./dotest.py -v -t array_types ---------------------------------------------------------------------- Collected 4 tests test_with_dsym_and_python_api (TestArrayTypes.ArrayTypesTestCase) Use Python APIs to inspect variables with array types. ... os command: [['/bin/sh', '-c', 'make clean; make MAKE_DSYM=YES CC=llvm-gcc']] output: rm -rf "a.out" "a.out.dSYM" main.o main.d llvm-gcc -arch x86_64 -gdwarf-2 -O0 -arch x86_64 -gdwarf-2 -O0 -c -o main.o main.c llvm-gcc -arch x86_64 -gdwarf-2 -O0 main.o -o "a.out" /usr/bin/dsymutil -o "a.out.dSYM" "a.out" ... llvm-svn: 113781
* Marked test_process_launch_for_universal() test case as requiring 'darwin' ↵Johnny Chen2010-09-031-0/+6
| | | | | | | | and 'i386' in order to be run. And added a default build phase at the beginning of the method. llvm-svn: 113037
* Changed the buildDsym()/buildDwarf() TestBase methods to use a plugin frameworkJohnny Chen2010-08-311-0/+15
to delegate the building of binaries to a sys.platform-sepcific plugin. Modified the dotest.py test driver to add the "plugins" directory to the PYTHONPATH as well. darwin.py is the Mac OS X plugin module. llvm-svn: 112606
OpenPOWER on IntegriCloud