Commit Graph

374 Commits

Author SHA1 Message Date
Zachary Turner cd236b8cc6 Python 3: Convert uses of `callable(x)` to `six.callable(x)`.
llvm-svn: 251329
2015-10-26 18:48:24 +00:00
Zachary Turner 1411668b6a Remove use of octal literals.
Python 3 has a different syntax for octal literals than Python 2
and they are incompatible with each other.  Six doesn't provide
a transparent wrapper around this, so the most sane thing to do
is to not use octal literals.  If you need an octal literal,
use a decimal literal and if it's not obvious what the value is,
provide the value in octal as a comment.

llvm-svn: 251328
2015-10-26 18:48:14 +00:00
Greg Clayton 22fd3b1dee Fixed the test suite on MacOSX so that "test/api/multithreaded/TestMultithreaded.py" works without errors.
The problem was that the @skipIfNoSBHeaders on darwin was trying to use self.lib_dir when it hadn't been set yet.

I looked at the code and places were required to set "self.lib_dir" for no real reason as all places that used it just used the LLDB_LIB_DIR environment variable. So I removed all uses of self.lib_dir and replaced them to use 'os.environ["LLDB_LIB_DIR"]'. Did the same for self.implib_dir.

llvm-svn: 251315
2015-10-26 17:52:16 +00:00
Pavel Labath dc8b2d3d3a Port the python api decorator to use test categories
Summary:
Per discussions on the mailing list, I have implemented a decorator which annotates individual
test methods with categories. I have used this framework to replace the '-a' and '+a'
command-line switches (now '-G pyapi' and '--skip-category pyapi') and the @python_api_test
decorator (now @add_test_categories('pyapi')). The test suite now gives an error message
suggesting the new options if the user specifies the deprecated +/-a switches. If the general
direction is good, I will follow this up with other switches.

Reviewers: tberghammer, tfiala, granata.enrico, zturner

Subscribers: lldb-commits

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

llvm-svn: 251277
2015-10-26 09:28:32 +00:00
Zachary Turner 606e1e33ef Python3 - Wrap more statements in calls to list()
llvm-svn: 251129
2015-10-23 17:53:51 +00:00
Zachary Turner 35d017f0fc Add from __future__ import print_function everywhere.
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
2015-10-23 17:04:29 +00:00
Zachary Turner 1c4059a0c4 Python 3 porting - Wrap returns from map() in list()
Under Python 2 this has no effect, since map() returns a list.
In Python 3 map() returns an iterable, so wrapping in a list is
necessary to keep the same semantics.

llvm-svn: 251060
2015-10-22 20:39:59 +00:00
Zachary Turner 814236d694 Use six to portably handle module renames in Python 2 and 3
llvm-svn: 250915
2015-10-21 17:48:52 +00:00
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