Commit Graph

366 Commits

Author SHA1 Message Date
Zachary Turner 43a01e45f9 Use six to portably assign metaclasses in Python 2 and 3.
llvm-svn: 250859
2015-10-20 21:06:05 +00:00
Zachary Turner ff890daf12 Convert print statements to print function calls.
This patch was generating by running `2to3` on the files in the
lldb/test directory.  This patch should be NFC, but it does
introduce the `from __future__ import print_function` line, which
will break future uses of the print statement.

llvm-svn: 250763
2015-10-19 23:45:41 +00:00
Adrian McCarthy 6ecdbc87e6 Factor the execution of the test method into a separate function to ensure that any exceptions that are thrown go out of scope and no longer hold references to SB objects that need to be freed before teardown.
Differential Revision: http://reviews.llvm.org/D13788

llvm-svn: 250467
2015-10-15 22:39:55 +00:00
Pavel Labath f882f6fcd5 dotest.py: Remove useless AttributeError catches
Summary:
Test decorators were ignoring AttributeError exceptions. These were introduced three years ago,
and copied to all decorators. They seem to serve no purpose and removing them produces no errors.
Given that they have prevented us from noticing the problem in r249819, I am removing them.

Reviewers: zturner, tfiala

Subscribers: iancottrell, lldb-commits

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

llvm-svn: 250038
2015-10-12 13:42:16 +00:00
Greg Clayton edea2371f3 Fix a test that should only be run with a dSYM file by adding @skipIfDwarf and using a new @skipIfDWO.
llvm-svn: 249601
2015-10-07 20:01:13 +00:00
Tamas Berghammer 11db2d3ddd Fix race condition in the working directory cleanup code
llvm-svn: 249549
2015-10-07 14:52:16 +00:00
Tamas Berghammer f2addf8905 Remove working directory from remote platform in the test suite
Previously we haven't cleaned up the working directory we created on
the remote platform and because of it we run out of storage on some
android device/emulator (caused by the 2x increase of the number of
test cases because of dwo).

llvm-svn: 249541
2015-10-07 12:38:29 +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 02c08d04e2 Modify minimumg go version to 1.4.0 for tests.
llvm-svn: 249477
2015-10-06 22:14:33 +00:00
Todd Fiala 9f23680a16 Bungled my last change in a tweak.
I took out a skip_test check that wasn't necessary, but
didn't fully yank it out.  Would break a normal go install.

llvm-svn: 249448
2015-10-06 19:23:22 +00:00
Todd Fiala be5dfc5065 Address failing Go tests on go version from Ubuntu 14.04
Go tests fail on Ubuntu 14.04's go1.2.1.  This change puts a minimum
go version in the skipUnlessGoInstalled() decorator of go1.3.0.
Go maintainers are encouraged to modify as needed.  For now this fixes
failing tests on Ubuntu 14.04 x86_64 buildbots with stock distro go installed.

llvm-svn: 249446
2015-10-06 19:15:56 +00:00
Enrico Granata bd0998a1be Do not attempt to join the remote paths if none exist
llvm-svn: 249210
2015-10-02 22:53:32 +00:00
Tamas Berghammer c8fd130a2c Merge dwarf and dsym tests
Currently most of the test files have a separate dwarf and a separate
dsym test with almost identical content (only the build step is
different). With adding dwo symbol file handling to the test suit it
would increase this to a 3-way duplication. The purpose of this change
is to eliminate this redundancy with generating 2 test case (one dwarf
and one dsym) for each test function specified (dwo handling will be
added at a later commit).

Main design goals:
* There should be no boilerplate code in each test file to support the
  multiple debug info in most of the tests (custom scenarios are
  acceptable in special cases) so adding a new test case is easier and
  we can't miss one of the debug info type.
* In case of a test failure, the debug symbols used during the test run
  have to be cleanly visible from the output of dotest.py to make
  debugging easier both from build bot logs and from local test runs
* Each test case should have a unique, fully qualified name so we can
  run exactly 1 test with "-f <test-case>.<test-function>" syntax
* Test output should be grouped based on test files the same way as it
  happens now (displaying dwarf/dsym results separately isn't
  preferable)

Proposed solution (main logic in lldbtest.py, rest of them are test
cases fixed up for the new style):
* Have only 1 test fuction in the test files what will run for all
  debug info separately and this test function should call just
  "self.build(...)" to build an inferior with the right debug info
* When a class is created by python (the class object, not the class
  instance), we will generate a new test method for each debug info
  format in the test class with the name "<test-function>_<debug-info>"
  and remove the original test method. This way unittest2 see multiple
  test methods (1 for each debug info, pretty much as of now) and will
  handle the test selection and the failure reporting correctly (the
  debug info will be visible from the end of the test name)
* Add new annotation @no_debug_info_test to disable the generation of
  multiple tests for each debug info format when the test don't have an
  inferior

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

llvm-svn: 248883
2015-09-30 10:12:40 +00:00
Adrian McCarthy d9dbae599d Add first tests for mini-dump debugging.
Differential Revision: http://reviews.llvm.org/D12888

llvm-svn: 247829
2015-09-16 18:17:11 +00:00
Ryan Brown 57bee1edfc Add a TypeSystem for Go
Add GoASTContext and DWARFASTParserGo to support go.

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

llvm-svn: 247629
2015-09-14 22:45:11 +00:00
Zachary Turner 14181dbb57 Fix a thinko causing test logs for crashes to not get written.
llvm-svn: 247479
2015-09-11 21:27:37 +00:00
Tamas Berghammer cf6f92a870 XFAIL TestBuiltinTrap on android-arm (gcc bug)
llvm-svn: 246971
2015-09-07 15:50:19 +00:00
Pavel Labath 63a579c752 Mark TestCreateDuringInstructionStep as flaky on android arm
llvm-svn: 246966
2015-09-07 12:15:27 +00:00
Adrian McCarthy a729204103 Sleep-and-retry after a failure to delete a log file, which may be because antimalware is holding the handle to the just-created file.
Differential Revision: http://reviews.llvm.org/D12641

llvm-svn: 246870
2015-09-04 20:48:48 +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
Pavel Labath 090152bd1f Skip TestCreateDuringInstructionStep on android aarch64
we are unable to step through _M_start_thread due to atomic instruction sequences.

llvm-svn: 245552
2015-08-20 11:37:19 +00:00
Zachary Turner 793d997585 Make skipUnlessArch decorator actually skip instead of XFAIL.
llvm-svn: 245127
2015-08-14 23:29:24 +00:00
Mohit K. Bhakkad c356d8be53 [LLDB][MIPS] Added expected failure for "test disassembler settings"
Patch by Nitesh Jain

Reviewers: clayborg, ovyalov.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, emaste, lldb-commits.
Differential Revision: http://reviews.llvm.org/D11562

llvm-svn: 243622
2015-07-30 05:45:56 +00:00
Oleksiy Vyalov abb5a35d05 Make DWARF at_comp_dir symbolic links configurable via plugin.symbol-file.dwarf.comp-dir-symlink-paths setting.
http://reviews.llvm.org/D11586

llvm-svn: 243580
2015-07-29 22:18:16 +00:00
Tamas Berghammer 050d1e8a34 XFAIL watchpoint tests on Android arm/aarch64
Differential revision: http://reviews.llvm.org/D11409

llvm-svn: 242887
2015-07-22 11:00:06 +00:00
Chaoren Lin e9bbabcc69 Apply Android -pie switch to buildDefault as well.
Reviewers: ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242598
2015-07-18 00:37:55 +00:00
Chaoren Lin 9070f53079 Detect if necessary to build inferior with -pie for Android.
Summary:
- Add target_is_android check (with cached results).
- Make android_device_api also cache results.
- Also removes the need to pass --env OS=Android when testing against Android.

Reviewers: sivachandra, tberghammer, clayborg, danalbert

Subscribers: chaoren, tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242580
2015-07-17 22:13:29 +00:00
Chaoren Lin 636a0e3836 Check if altsep exists before replace.
llvm-svn: 242576
2015-07-17 21:40:11 +00:00
Chaoren Lin f355eda567 Handle altsep ('/' on Windows) in compiler path for log files.
Reviewers: chying

Subscribers: lldb-commits

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

llvm-svn: 242575
2015-07-17 21:37:26 +00:00
Adrian McCarthy 137d7ba8b2 Fix _LocalProcess.terminate on Windows.
llvm-svn: 241589
2015-07-07 14:47:34 +00:00
Sean Callanan 05834cd2ad Reversed r238363, because the message is inconsistent
with all the other assertion messages.

llvm-svn: 241212
2015-07-01 23:56:30 +00:00
Ying Chen 0a7202bb5d Run teardown and setup before retry for expectedFlakey tests
Summary:
If test is decorated with expectedFlakey*, run teardown and setup before retry
Don't run retry if the test is already decorated with xfail or skip

Test Plan:
Mark TestMultithreaded.test_sb_api_listener_event_process_state as expectedFlakey
Run ./dotest.py -p TestMultithreaded.py -A x86_64 -C gcc4.9.2

Reviewers: vharron, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 241202
2015-07-01 22:44:27 +00:00
Vince Harron 7ac3ea424b Added expectedFlakey test decorator
SUMMARY
Flakey tests get two chances to pass

Also, switched a bunch of tests to use new decorator.

TEST PLAN
Add one of these decorators to a test
Edit a test to pass on the first invocation, confirm test appears as pass
Edit a test to pass on the first invocation, pass on the second, confirm test appears as xfail
Edit a test to fail on two consecutive runs, confirm test appears in results as fail/error

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

llvm-svn: 240789
2015-06-26 15:13:21 +00:00
Pavel Labath b36f917854 Remove old local-only linux debugging code
Summary:
Currently, the local-only path fails about 50% of the tests, which means that: a) nobody is using
it; and b) the remote debugging path is much more stable. This commit removes the local-only
linux debugging code (ProcessLinux) and makes remote-loopback the only way to debug local
applications (the same architecture as OSX). The ProcessPOSIX code is moved to the FreeBSD
directory, which is now the only user of this class. Hopefully, FreeBSD will soon move to the new
architecture as well and then this code can be removed completely.

Test Plan: Test suite passes via remote stub.

Reviewers: emaste, vharron, ovyalov, clayborg

Subscribers: tberghammer, emaste, lldb-commits

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

llvm-svn: 240543
2015-06-24 14:43:20 +00:00
Siva Chandra 4470f3826c [TestLoadUnload] Enable for Android while skipping it for other remotes.
Summary:
This change adds all the necessary infrastructure required to
selectively enable and make TestLoadUnload work for Android. One test,
which tests the module search paths, is still kept disabled for remote
as search paths (because of module caching) are local anyway.

Reviewers: tberghammer

Reviewed By: tberghammer

Subscribers: emaste, lldb-commits, tberghammer

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

llvm-svn: 239965
2015-06-17 22:32:27 +00:00
Chaoren Lin f7160f3fba XFail pexpect tests for Windows hosts.
Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 239414
2015-06-09 17:39:27 +00:00
Chaoren Lin e6eea5d055 Skip TestInferiorChanged if host platform is windows.
Summary: Opened files on Windows cannot be modified, so this test doesn't make sense.

Reviewers: ovyalov, zturner, flackr, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 239359
2015-06-08 22:13:28 +00:00
Chaoren Lin 5d76b1b56e Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.
Summary: Updated `append_to_remote_wd` to work for both remote and local.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239203
2015-06-06 00:25:50 +00:00
Siva Chandra 77f20fc8d3 [TestGdbRemoteAbort] Skip on API 16 Android devices
Summary:
This change also adds the infrastructure required to specify the API
levels for which tests should be skipped.

Reviewers: chying, labath

Reviewed By: labath

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239183
2015-06-05 19:54:49 +00:00
Siva Chandra 29e0392944 [lldbtest] Use netloc instead of hostname to look up Android device ID.
Summary:
urlparse.ParseResult.hostname has only lowercase characters even if the
input URL had uppercase characters. Since Android device IDs can have
uppercase characters as well, use urlparse.ParseResult.netloc instead
and extract the device ID from it.

This change also improves the error message when lookup of the Android
device's API fails.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239173
2015-06-05 18:07:10 +00:00
Siva Chandra 8af9166efe [TestChangeProcessGroup] Mark the test as xfail for Android API 16
Summary:
This change adds the infrastructure to mark tests as xfail for specific
Android API levels.

Test Plan: dotest.py TestChangeProcessGroup on an Android API 16 device.

Reviewers: chying, labath, chaoren

Reviewed By: labath, chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239126
2015-06-05 00:22:49 +00:00
Pavel Labath 674bc7b0c4 XFAIL two tests for android
bug #23694

llvm-svn: 238558
2015-05-29 14:54:46 +00:00
Siva Chandra 3154aa23f3 [TestBase.runCmd] Better error message when runCmd fails.
Summary:
Before:
    AssertionError: False is not True : Process is launched successfully

After:
    AssertionError: False is not True : Command 'run a.out' failed.
    >>> error: invalid target, create a target using the 'target create' command
    >>> Process could not be launched successfully

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, vharron

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

llvm-svn: 238363
2015-05-27 22:27:41 +00:00
Zachary Turner 306278ff0d Also don't try to copy a logfile if it doesn't exist.
In some cases no log file will be written, so don't attempt to
call os.rename() with a non-existent source path.

llvm-svn: 238248
2015-05-26 20:26:29 +00:00
Zachary Turner 5de068bf31 On Windows, delete existing log file before renaming temp file.
On non-Windows platforms, os.rename() will silently replace the
destination file if it already exists.  On Windows, it doesn't do
this, and the filesystem has no mechanism to simulate the same type
of atomic rename operation.  So on Windows, delete the file first
before calling os.rename().

llvm-svn: 238239
2015-05-26 19:52:24 +00:00
Zachary Turner b48b40405e Don't import module `lock` at global scope.
`lock` depends on `fcntl`, which doesn't exist on Windows.  Until
someone implements an equivalent locking mechanism on Windows, we
can't have lock imported globally.

llvm-svn: 237946
2015-05-21 20:16:02 +00:00
Vince Harron 85d1965abd dotest.py - debug feature that helps find dosep races
SUMMARY
dosep.py starts lots and lots of dotest instances.

This option helps you find if two (or more) dotest instances are using
the same directory at the same time.

Enable it to cause test failures and stderr messages if dotest
instances try to run in the same directory simultaneously.

It is disabled by default because it litters the test directories with
".dirlock" files

TEST PLAN
Set lldbtest.debug_confirm_directory_exclusivity = True
run ./dosep.py

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

llvm-svn: 237935
2015-05-21 19:09:29 +00:00
Vince Harron 1f160377ae Re-enable packet logging for GdbRemote/LldbServer tests
Creates logs in session dir

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

llvm-svn: 237931
2015-05-21 18:51:20 +00:00
Vince Harron 35b17dca50 dotest.py - log session to a file instead of a StringIO class
That way, if the test gets killed (by a dosep timeout) we get to see the session
trace

Test Plan:
Run dotest.py
Kill it while it's running, check the session dir for Test* files

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

llvm-svn: 237926
2015-05-21 18:20:21 +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