Commit Graph

259 Commits

Author SHA1 Message Date
Enrico Granata a512103bdf Add a flakey category for flakey tests
llvm-svn: 250750
2015-10-19 22:53:34 +00:00
Pavel Labath 6204506fa6 dotest.py: Fail if we detect multiple tests with the same name
Summary:
Log files produced by dotest have names derived from the test name, and this produces errors in
case we have multiple tests with the same name. Additionally, it's good if the test name explains
what the test is testing (which it clearly doesn't do well if there are multiple tests with
identical names). This commit makes the presence of such tests a hard error.

Reviewers: tberghammer, zturner

Subscribers: iancottrell, lldb-commits

Differential Revision: http://reviews.llvm.org/D13588

llvm-svn: 249828
2015-10-09 12:48:17 +00:00
Tamas Berghammer 6f5d647c17 Fix the way dwo tests are skipped on darwin
We want to skip these tests when the target platform is darwin, not
when the host because they have to be enabled in case of darwin ->
android

llvm-svn: 249825
2015-10-09 12:06:07 +00:00
Pavel Labath 8112dd9951 Fix disabling of dwo tests
without this, dwo tests would be run even if they were meant to be disabled.

llvm-svn: 249819
2015-10-09 10:09:36 +00:00
Greg Clayton db2a576a77 Don't do DWO tests on darwin as they aren't supported. If this is an error and they are supported, we need to add support _only_ if the clang compiler that is being used supports the compiler option for DWO stuff as right now I just get an error saying "warning: unused option -gsplit-dwarf". So unless we can successfully test if "-gsplit-dwarf" is truly supported, I am going to disable it on darwin for now so we don't get test suite failures.
llvm-svn: 249625
2015-10-07 22:06:08 +00:00
Tamas Berghammer 4c0c7a7f52 Run tests with dwo symbol files
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
2015-10-07 10:02:17 +00:00
Todd Fiala ea594abc78 test framework: fixed issue when using results formatter with no formatter options
I broke the formatter options-passing parsing when no formatter
options are provided.

llvm-svn: 248397
2015-09-23 17:20:09 +00:00
Todd Fiala ea73624e5f Cleaned up results formatter options hand-off.
* --results-formatter-options renamed to --results-formatter-option,
  with short version of -O

* Multiple --results-formatter-option=OPTION can be specified.  The
  comma-separating mechanism has been removed.

* XunitFormatter options modified: -n and -r are now short forms of
  --ignore-skip-name and --ignore-skip-reason.  Those long option
  names were tweaked lightly.  They also can be specified multiple
  times on the command line.  The comma-separating, multiple-pattern-
  per-option mechanism has been removed.

One can now specify:

  dotest.py --results-file stdout -O-ndsym -O-nlldb-mi

for example, to ignore reporting skips for dsym-related or lldb-mi-related
tests in the xUnit report.

llvm-svn: 248384
2015-09-23 15:21:28 +00:00
Todd Fiala de9a44e3e9 test framework: parallel test runner sends terminate to formatter before printing to stdout
The parallel test runner now sends the terminate event to the formatter
(if there is one) after the parallel test runs but before dumping anything
to stdout/stderr at the end of the run.  This allows the existing
stdout/stderr summary reporting to co-exist nicely with a formatter like
the test_results.Curses that otherwise clobbers the screen.

llvm-svn: 248228
2015-09-22 00:15:50 +00:00
Todd Fiala 40b180e7ee test events: added optional value type to extra event key/val pairs
The test events had worker indexes coming across as strings.  I
want them to be ints.  worker_index now comes across as an int in
the dicationary.

The optional type can be specified with:
--event-add-entries key=val[:type][,key2=val2[:type2]...]
The type piece may be 'int' at this time.  That is all.  Otherwise
it will be a string.

llvm-svn: 248066
2015-09-18 23:46:30 +00:00
Todd Fiala e83f140833 test events: announce worker count in new initialize event
See the following for details:
http://reviews.llvm.org/D12987

llvm-svn: 248059
2015-09-18 22:45:31 +00:00
Todd Fiala 33896a9872 Adds parallel work queue index to test events, stdout/stderr results support.
See http://reviews.llvm.org/D12983 for details.

llvm-svn: 248036
2015-09-18 21:01:13 +00:00
Todd Fiala 68615ce606 Add JUnit/XUnit-formatted output to the lldb test run system
Also introduces the test event system into our test runner framework.
See the following for details:
http://reviews.llvm.org/D12831

llvm-svn: 247722
2015-09-15 21:38:04 +00:00
Ilia K dae2e564d8 Fix an AttributeError in dotest.py if --executable points to a wrong place
This patch fixes the following case:
```
  $ ./dotest.py --executable=~/p/llvm/build_ninja/bin/lldb tools/lldb-mi/
  '~/p/llvm/build_ninja/bin/lldb' is not a path to a valid executable
  Traceback (most recent call last):
    File "./dotest.py", line 1306, in <module>
      setupSysPath()
    File "./dotest.py", line 1004, in setupSysPath
      if not lldbtest_config.lldbExec:
  AttributeError: 'module' object has no attribute 'lldbExec'
```

And with this fix:
```
  $ ./dotest.py --executable=~/p/llvm/build_ninja/bin/lldb tools/lldb-mi/
  '~/p/llvm/build_ninja/bin/lldb' is not a path to a valid executable
  The 'lldb' executable cannot be located.  Some of the tests may not be run as a result.
```

llvm-svn: 247256
2015-09-10 09:24:43 +00:00
Todd Fiala a195adde00 Fix regressions in dotest.py when passing filters or directories.
See https://llvm.org/bugs/show_bug.cgi?id=24708 for details.
Using '-f FILTER' or unnamed arguments (directories) to dotest.py
will now force no-multiprocessing mode.  This stops a bombardment
of test output spam when following the instructions we provide
in a test session trace for rerunning the test.

llvm-svn: 247101
2015-09-08 23:22:19 +00:00
Todd Fiala 8cbeed3248 dotest.py ctrl-c support, addition of --test-runner-name option.
See http://reviews.llvm.org/D12651 for more details.

For the parallel test runner, -v now also implies --output-on-success.

llvm-svn: 247084
2015-09-08 22:22:33 +00:00
Zachary Turner b8dec76f26 Protect dotest.py with an if __name__ == "__main__"
llvm-svn: 246816
2015-09-03 23:03:16 +00:00
Todd Fiala fed95660f3 Roll dosep.py parallel test runner into dotest.py command line
See the following for details:
http://reviews.llvm.org/D12587

llvm-svn: 246794
2015-09-03 18:58:44 +00:00
Zachary Turner b1490b6172 Don't throw an exception when module cleanup fails.
Just because one test fails to clean up correctly, it should not
prevent other tests from attempting to run.

llvm-svn: 246063
2015-08-26 19:44:56 +00:00
Chaoren Lin bb2cc9cf56 Unique file names for TestStarted and TestFinished.
Summary: This fixes the issue of multiple test suites opening the same file for writing.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10284

llvm-svn: 239188
2015-06-05 21:08:24 +00:00
Vince Harron 8994fedc2b dotest.py - fixed a bug displaying usage
./dotest.py --help

llvm-svn: 238043
2015-05-22 19:49:23 +00:00
Vince Harron 47fc26f9fe Fix lldb executable discovery on OS X
It was broken by r237632

Differential Revision: http://reviews.llvm.org/D9846

llvm-svn: 237928
2015-05-21 18:21:07 +00:00
Vince Harron a7959f6585 trivial log print fix
llvm-svn: 237878
2015-05-21 05:57:28 +00:00
Vince Harron d347f27f45 dotest - minor doc fix
llvm-svn: 237665
2015-05-19 05:10:22 +00:00
Vince Harron 0c6160156a Make it possible to run dotest on Linux without any parameters
dotest will select clang-3.5 by default and fall back on clang/gcc
dotest will look for the lldb executable in the typical cmake
output locations:
{lldb}/../../../build/bin (next to llvm directory)
{lldb}/../../../build/host/bin (next to llvm directory)
{lldb}/../build/bin (next to lldb directory)
{lldb}/../build/host/bin (next to lldb directory)

llvm-svn: 237632
2015-05-18 23:07:18 +00:00
Vince Harron f8b9a1da2b Refactored dotest arg parser so that it's accessible from dosep
This allows dosep to understand an act on dotest arguments

Differential Revision: http://reviews.llvm.org/D9820

llvm-svn: 237602
2015-05-18 19:40:54 +00:00
Vince Harron f1518f5981 dotest - Refactored some code into loops
Renamed 'base' to 'lldbRootDirectory'
Renamed 'lldbPath' to 'lldbPythonDir'
Added cmake output directories to lldb executable search locations
Fixed invocation of lldb -P to ignore 'Cannot read termcap database'

Differential Revision: http://reviews.llvm.org/D9818

llvm-svn: 237601
2015-05-18 19:40:00 +00:00
Vince Harron 790d95cbec Refactored lldb executable name discovery
The lldb executable was referenced through the code by 7 different
(effectively) global variables.

global lldbExecutablePath
global lldbExecutable
os.environ['LLDB_EXEC']
os.environ['LLDB_TEST']
dotest.lldbExec
dotest.lldbHere
lldbtest.lldbExec

This change uses one global variable lldbtest_config.lldbExec to
replace them all.

Differential Revision: http://reviews.llvm.org/D9817

llvm-svn: 237600
2015-05-18 19:39:03 +00:00
Zachary Turner fb69dd8b64 Don't import lock on Windows.
lock imports fcntl, which doesn't exist on Windows.  If we need
to use this class on Windows, we will need to implement something
based on the CreateMutex API.

llvm-svn: 237292
2015-05-13 20:21:33 +00:00
Vince Harron 05df698d2b Darwin - fix intermitent crashes in import crashinfo
Summary:
"import crashinfo" was probably failing because multiple dotest invocations
are all trying to compile crashinfo.so at the same time.
    
I've put a mutex around the compile step to prevent this.
   
Reviewers: clayborg, chying
    
Subscribers: lldb-commits
    
Differential Revision: http://reviews.llvm.org/D9732

llvm-svn: 237230
2015-05-13 05:00:23 +00:00
Vince Harron d5fa102d44 We can't use sys.path[0] to determine the script directory because it doesn't work under a debugger
Test Plan: run tests with/without python debugger
Tested on OSX & Linux with PyCharm

Reviewers: chying, clayborg

Differential Revision: http://reviews.llvm.org/D9593

llvm-svn: 236957
2015-05-10 15:24:12 +00:00
Vince Harron 9753dd98b3 Add support for ./dotest.py --channel and --log-success
Summary:
New dotest options that allow arbitrary log channels and
categories to be enabled.  Also enables logging for locally run
debug servers.
    
Log messages are separated into separate files per test case.
(this makes it possible to log in dosep runs)
    
These new log files are stored side-by-side with trace files in the
session directory.
    
These files are deleted by default if the test run is successful.
    
If --log-success is specified, even successful logs are retained.
    
--log-success is useful for creating reference log files.
    
Test Plan:
add '--channel "lldb all" --channel "gdb-remote packets" --log-success'
to your dotest options

Tested on OSX and Linux
    
Differential Revision: http://reviews.llvm.org/D9594

llvm-svn: 236956
2015-05-10 15:22:09 +00:00
Adrian McCarthy c99d2fadb5 Don't attempt DSym tests on Windows.
llvm-svn: 236620
2015-05-06 18:19:51 +00:00
Chaoren Lin f62b7fc317 Fix typo. platfrom -> platform
llvm-svn: 236543
2015-05-05 20:34:36 +00:00
Robert Flack 068898cb83 Fix @skipUnlessPlatform and @skipIfPlatform decorators to work on classes.
The decorators to skip if or unless certain platforms relied on calling
skipTest, which only worked if they were decorating individual test cases.
However for decorating entire classes it needs different behavior. This behavior
is already encapsulated in unittest2.skipIf and unittest2.skipUnless so this
modifies the platform decorators to use these unittest skip decorators.

Test Plan:
./dotest.py -t -p TestObjCMethods2.py
See skipped tests on linux, and see tests run on macosx.

Differential Revision: http://reviews.llvm.org/D8903

llvm-svn: 234514
2015-04-09 18:07:58 +00:00
Chaoren Lin d702203c5e Use insert instead of append when adding to sys.path.
Similar problem as in the last part of r200486.

llvm-svn: 234071
2015-04-04 01:11:31 +00:00
Zachary Turner 43bac098b0 [dotest.py] Present a better error when lldb module can't be found.
We try to run lldb -P and jump through a bunch of other hoops
to figure out where the Python module is so that we can add its
location to sys.path.  The error message printed when this
doesn't work was left over from the time when Mac was the only
platform, so it presented a Mac-specific diagnostic on all
platforms related to the LLDB Framework.  This patch prints
a more useful diagnostic when not on Mac that gives a number
of other diagnostic messages to check.

llvm-svn: 234049
2015-04-03 20:56:15 +00:00
Tamas Berghammer de7867938b Fix TestGdbRemote* on remote linux
Differential revision: http://reviews.llvm.org/D8454

llvm-svn: 233531
2015-03-30 10:52:32 +00:00
Adrian McCarthy b016b3cfea Fix lld command on Windows for many tests.
llvm-svn: 233416
2015-03-27 20:47:35 +00:00
Robert Flack efa49c2665 Change expectedFailureOS and skipIfPlatform checks to be based on target platform when running test suite remotely.
Most expected OS failures or skipped tests are about the target platform on
which the test binary is being run, not the host platform launching the tests.
This changes expectedFailureOS and skipIfPlatform to check against the remote
platform when running remote tests.

Test Plan:
Run ./do_sep.py test suite against a remote target on a different platform and
verify that tests which should be excluded on the remote platform are excluded.

Differential Revision: http://reviews.llvm.org/D8611

llvm-svn: 233311
2015-03-26 19:34:26 +00:00
Ilia K ba6d7b6004 Add lldb-mi/lldb-server test folders to PATH before in dotest.py
Summary:
This patch allows not specify search path in each lldb-mi test. It makes tests easier.

This fix was requested by vharron.

All test pass on OS X.

Reviewers: vharron, clayborg

Subscribers: lldb-commits, vharron

Differential Revision: http://reviews.llvm.org/D8207

llvm-svn: 232019
2015-03-12 07:32:32 +00:00
Robert Flack 8cc4cf178c Rename test/tools/lldb-gdbserver to test/tools/lldb-server
As requested in http://reviews.llvm.org/D7545 this change moves test/tools/lldb-gdbserver to test/tools/lldb-server ot match the name of the target being tested.

Differential Revision: http://reviews.llvm.org/D8061

llvm-svn: 231479
2015-03-06 14:36:33 +00:00
Tamas Berghammer 6723ecb552 Add option to set environment variables from dotest.py
Setting environment variables are required when testing on a remote
target requiring different flags then the ones specified on the host OS.

Differential revision: http://reviews.llvm.org/D7854

llvm-svn: 230485
2015-02-25 12:22:40 +00:00
Ed Maste 55f74e829b test: Add workaround for FreeBSD libedit vs readline issue
If stdout is not a terminal Python executes
    rl_variable_bind ("enable-meta-key", "off");

This produces a warning with FreeBSD's libedit because the
enable-meta-key variable is unknown.  Not an issue on Apple because
cpython commit f0ab6f9f0603 added a #ifndef __APPLE__ around the call.
See http://bugs.python.org/issue19884 for more information.

For now we just discard the warning output to get the tests working
again on FreeBSD.

llvm-svn: 226037
2015-01-14 20:32:33 +00:00
Stephane Sezer 24a14c93e6 Modify dotest.py to be able to run without an lldb build.
Summary: This will ease llgs development a bit by not requiring an lldb/lldb.py build to launch the tests. Also, we can now use LLDB_DEBUGSERVER_PATH to point to a debug server to use to run the tests. I used that to point to a ds2 build and run llgs tests against ds2.

Reviewers: clayborg, tfiala, vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D6554

llvm-svn: 225549
2015-01-09 21:54:27 +00:00
Enrico Granata 9aa7e8e9ff Dynamic values have been around (and stable and reliable) for long enough that we can turn them on by default
Change the default of prefer-dynamic-value to eDynamicDontRunTarget (i.e. enable dynamic values, but do not run code to do so)

Of course, disable this for the test suite, since testing no-dynamic-values is actually valuable

Fixes rdar://17363061

llvm-svn: 225486
2015-01-09 00:47:24 +00:00
Hafiz Abid Qadeer 547cb78774 Fixed 2 typos in help.
llvm-svn: 224331
2014-12-16 10:20:35 +00:00
Zachary Turner 555a7a6ad2 Add a method to disable the Windows crash / assert dialogs.
When running the test suite on Windows, we can't have Windows popping
up dialogs when LLDB crashes in native code because it will hang
the test suite.  This patch silences those dialogs by checking an
environment variable at startup and configuring Windows based on
its value.

This patch also adds an environment variable to force inferiors to
never spawn in their own console window.  This is useful to prevent
new window spawm when running the test suite.

Reviewed by: Scott Graham

Differential Revision: http://reviews.llvm.org/D6628

llvm-svn: 224137
2014-12-12 18:10:52 +00:00
Stephane Sezer 7a1d22a2af Fix a crash in dotest.py when the lldb executable is not built.
Summary: If lldb is not built, dotest.py throws an exception because we are using an unset variable.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D6516

llvm-svn: 223446
2014-12-05 05:02:41 +00:00
Hafiz Abid Qadeer 1cbac4e94f Add initial lldb-mi tests.
Test 'test_lldbmi_interrupt' is only enabled for Darwin as
it seems to cause a timeout error on Linux.
Patch from dawn@burble.org.

llvm-svn: 222750
2014-11-25 10:41:57 +00:00