Commit Graph

56 Commits

Author SHA1 Message Date
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 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 77db4a8552 Update every test to import `lldb_shared`.
This is necessary in order to allow third party modules to be
located under lldb/third_party rather than under the test
folder directly.

Since we're already touching every test file anyway, we also
go ahead and delete the unittest2 import and main block wherever
possible.  The ability to run a test as a standalone file has
already been broken for some time, and if we decide we want this
back, we should use unittest instead of unittest2.

A few places could not have the import of unittest2 removed,because
they depend on the unittest2.expectedFailure or skip decorators.
Removing all those was orthogonal in spirit to the purpose of this
CL, so the import of unittest2 remains in those files that were
using it for its test decorators.  Those can be addressed
separately.

llvm-svn: 251055
2015-10-22 20:06:20 +00:00
Jason Molenda f415791bda In r240466, when Greg added the jThreadsInfo packet, he accidentally
disabled the use of the jThreadGetExtendedInfo packet which is used
to retrieve additional information about a thread, such as the QoS
setting for that thread on darwin systems.  

Re-enable the use of the jThreadGetExtendedInfo packet, and add 
some quick tests to the TestQueues mac test case which will verify
that we can retrieve the QoS names for these test threads.

<rdar://problem/22925096> 

llvm-svn: 250364
2015-10-15 04:20:42 +00:00
Greg Clayton 69d25a8d7b Expected fail this test and supplied the radar number that is tracking the fix.
llvm-svn: 249631
2015-10-07 22:36:52 +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
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
Chaoren Lin 52cf8ecc23 Check before using platform specific attributes.
Summary: `os.uname` in TestUniversal and `os.geteuid` in TestTerminal.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 239135
2015-06-05 06:28:43 +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
Robert Flack 13c7ad9cd2 Replace sys.platform skips in tests with @skip decorators which check against remote platform.
Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if /
unless the target platform is in the provided platform list.

Test Plan:
ninja check-lldb shows no regressions.
When running cross platform, tests which cannot run on the target platform are
skipped.

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

llvm-svn: 233547
2015-03-30 14:12:17 +00:00
Zachary Turner 7d186c0152 Remove shell-globbing from all test makefiles.
llvm-svn: 214441
2014-07-31 21:03:11 +00:00
Zachary Turner 045fde58d1 Fixes a number of issue related to test portability on Windows.
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
2014-07-18 01:02:02 +00:00
Jason Molenda b4892cd266 Add a new SBThread::SafeToCallFunctions API; this calls over to
the SystemRuntime to check if a thread will have any problems 
performing an inferior function call so the driver can skip
making that function call on that thread.  Often the function
call can be executed on another thread instead.
<rdar://problem/16777874> 

llvm-svn: 208732
2014-05-13 22:02:48 +00:00
Jason Molenda b9ffa98cab Add a new SBThread::GetQueue() method to get the queue that is
currently associated with a given thread, on relevant targets.

Change the queue detection code to verify that the queues 
associated with all live threads are included in the list.
<rdar://problem/16411314> 

llvm-svn: 207160
2014-04-25 00:01:15 +00:00
Todd Fiala e373b68977 Fixed up intermittently failing tests to skip on Linux.
Also added 'import sys' on some tests that are using non-standard
unittest2.skipUnless blocks with code that is intended to do things
that we have more specializes @* attributes for.  These skip
conditions were failing to execute due to missing import, causing
darwin-only tests to run on Linux regardless.  Will file a bug for
that separately.

llvm-svn: 204747
2014-03-25 18:55:48 +00:00
Jason Molenda b00cc1f92f Refactor the Queues test case a little based on feedback from Jim.
Add queues tests for when libBacktraceRecording is absent.

llvm-svn: 203864
2014-03-13 23:04:22 +00:00
Jason Molenda 846952f5d4 Also check if the queues are serial or concurrent.
llvm-svn: 203755
2014-03-13 05:43:18 +00:00
Jason Molenda 7f8b9111a5 Add a quick test case for some of the queues debugging support.
It should only run on Darwin systems, and only when a couple of
libraries are available.

llvm-svn: 203754
2014-03-13 05:37:51 +00:00
Jim Ingham 4746a90d66 Change the name of the test class for this test (was copy/paste value...)
llvm-svn: 199251
2014-01-14 19:48:23 +00:00
Jim Ingham 0f7e294d65 Remove a compilation warning in the test case main.c file.
llvm-svn: 199243
2014-01-14 18:46:15 +00:00
Jim Ingham fc4a4e4e51 This is a macosx specific test case for stepping & setting breakpoints on indirect
and re-exported symbols.  I don't know if Linux has the latter, if it does, we could
probably make this a generic test.  Somebody who knows how to make these gadgets on 
Linux can maybe take a look...

llvm-svn: 199134
2014-01-13 20:44:26 +00:00
Greg Clayton c694751a06 Correctly set the working directory when launching processes for both local and remote targets.
llvm-svn: 197266
2013-12-13 19:18:59 +00:00
Greg Clayton 4570d3eba0 Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case.
This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated.

Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you. 

llvm-svn: 196985
2013-12-10 23:19:29 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Jason Molenda 680a7d7703 A new test case which adds a dSYM to an executable mid-debug session
where the executable has been slid.  This detects the regression fixed in
r188289.

llvm-svn: 188443
2013-08-15 02:49:16 +00:00
Stefanus Du Toit 8742add4b1 Add missing -Xlinker to order test.
Both the parameter itself and the argument to the parameter must be prefixed
with -Xlinker so that they are passed properly.

llvm-svn: 187432
2013-07-30 19:19:55 +00:00
Jim Ingham 63dfc725a7 Fix all the test case breakages caused by folks writing tests all over the place that depended explicitly
on the output of "break set".  Please don't do this sort of thing!!!!!

llvm-svn: 164433
2012-09-22 00:05:11 +00:00
Greg Clayton 7051231709 <rdar://problem/11358639>
Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.

Also make the selection process for auto selecting platforms based off of an arch much better.

llvm-svn: 156354
2012-05-08 01:45:38 +00:00
Johnny Chen 910667004f Remove the expectedFailure decorator as the bug has been fixed.
llvm-svn: 155264
2012-04-21 01:02:50 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Johnny Chen b58337cd45 Add a Test case to make sure that __apple_types section does get produced by dsymutil.
This is supposed to succeed even with rdar://problem/11166975.

llvm-svn: 153919
2012-04-03 01:07:24 +00:00
Johnny Chen 1b8af41116 Add some more debug prints and retrieve the debug subsections from the DWARF section.
llvm-svn: 153915
2012-04-03 00:41:25 +00:00
Johnny Chen d6fbc8ff66 Add testcase that verifies that __apple_types is a valid section in a .o file generated by clang.
rdar://problem/11167268

llvm-svn: 153891
2012-04-02 19:46:14 +00:00
Johnny Chen 7840c81df2 Modify a couple of Makefiles to use clang instead of gcc, since gcc is being deprecated.
llvm-svn: 148071
2012-01-12 23:50:28 +00:00
Johnny Chen 025c58fc15 Patches for running some of the Linux tests from Dawn, thanks!
With some minor modification from me.

llvm-svn: 147160
2011-12-22 19:21:46 +00:00
Johnny Chen fc7483f699 Add a simple test case to exercise the SBDebugger.CreateTargetWithFileAndTargetTriple() API.
llvm-svn: 137544
2011-08-13 00:55:56 +00:00
Johnny Chen f017e8d6d7 Modify the skipUnless() logic to work for OSX Lion.
llvm-svn: 137542
2011-08-13 00:27:46 +00:00
Johnny Chen fd70999bb4 Move top level test dirs platform and inferior-crashing to reside under functionalities and order to reside under macosx.
llvm-svn: 133919
2011-06-27 18:25:00 +00:00
Johnny Chen 4ebd019b97 Now that we have added a post-processing step for adding truth value testing to
those lldb objects which implement the IsValid() method, let's change the rest of
the test suite to use the more compact truth value testing pattern (the Python way).

llvm-svn: 131970
2011-05-24 18:22:45 +00:00
Johnny Chen b21c52eac8 Add test scenario to verify 'eax' register is available when launching the i386 slice
of a universal binary and 'rax' register is available when launching the x86_64 slice.

rdar://problem/9403437

llvm-svn: 131069
2011-05-08 17:25:27 +00:00
Johnny Chen 933fefdd6a Add new radar info for failed test.
llvm-svn: 125100
2011-02-08 18:37:49 +00:00
Johnny Chen 78bb926f9b Make the assertion message about 32-bit process address byte size more clear.
llvm-svn: 125099
2011-02-08 18:31:06 +00:00
Johnny Chen 769302a97f Parametrize make variable CC to also test with clang.
llvm-svn: 124764
2011-02-03 00:44:32 +00:00
Johnny Chen d6c05708eb Remove @expectedFailure decorator as the bug has been fixed.
llvm-svn: 120624
2010-12-01 23:15:58 +00:00
Johnny Chen c7c03d919a Add @expectedFailure decorator for a known bug:
rdar://problem/8689814 test failure: test/macosx/universal (the i386 slice does not break?)

llvm-svn: 120505
2010-12-01 00:03:17 +00:00
Johnny Chen 98d9c79e7d Make the specification of relative directory more robust.
llvm-svn: 118511
2010-11-09 17:09:20 +00:00
Johnny Chen aadcef54de Make calling the super class's setUp() method less fragile.
llvm-svn: 116490
2010-10-14 17:31:24 +00:00
Johnny Chen 0924b41201 Avoid using hardcoded line number to break on. Use the line_number() utility
function to get the line number to break on during setUp().

llvm-svn: 116356
2010-10-12 22:39:52 +00:00
Johnny Chen 1b1b9accd1 Marked test_process_launch_for_universal() test case as requiring 'darwin' and 'i386'
in order to be run.  And added a default build phase at the beginning of the method.

llvm-svn: 113037
2010-09-03 23:49:16 +00:00
Johnny Chen cbb4be0c93 Changed the test case class names to be noun-like instead of verb-like.
llvm-svn: 112732
2010-09-01 19:59:58 +00:00