Commit Graph

45 Commits

Author SHA1 Message Date
Vedant Kumar 48ffd5cc6e [test] Replace some references to Apple-internal bugs
This removes around 10 references to Apple-internal radars. I've filed
fresh bugs on bugs.llvm.org as appropriate for open issues.

llvm-svn: 327463
2018-03-13 23:37:11 +00:00
Frederic Riss 0fda3a8721 Fix TestMultithreaded when there's no debugserver specified
r325858 was bogus and would error out with a KeyError when --server
was not passed to dotest.py.

llvm-svn: 325862
2018-02-23 05:29:27 +00:00
Frederic Riss 8492f2081d Fix TestMultithreaded when specifying an alternative debugserver.
Summary:
This test launches a helper that uses the debugserver. The environment
variable sepcifying the debug server wasn't passed to this helper, thus
it was using the default one.

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D43546

llvm-svn: 325858
2018-02-23 05:03:09 +00:00
Adrian Prantl 332351d9b9 Build each testcase variant in its own subdirectory and remove the srcdir lock file
This patch creates a <test>.dwarf, <test>.dwo, etc., build directory for each testcase variant.
Most importantly, this eliminates the need for the per-test lock file in the source directory.

Tests that are marked as NO_DEBUG_INFO_TESTCASE and build with
buildDefault() are built in a <test>.default build directory.

Differential Revision: https://reviews.llvm.org/D42763

llvm-svn: 324368
2018-02-06 18:22:51 +00:00
Adrian Prantl 5ec76fe720 Compile the LLDB tests out-of-tree.
This patch is the result of a discussion on lldb-dev, see
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for
background.

For each test (should be eventually: each test configuration) a
separate build directory is created and we execute

  make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test

In order to make this work all LLDB tests need to be updated to find
the executable in the test build directory, since CWD still points at
the test's source directory, which is a requirement for unittest2.

Although we have done extensive testing, I'm expecting that this first
attempt will break a few bots. Please DO NOT HESITATE TO REVERT this
patch in order to get the bots green again. We will likely have to
iterate on this some more.

Differential Revision: https://reviews.llvm.org/D42281

llvm-svn: 323803
2018-01-30 18:29:16 +00:00
Adrian Prantl 43a68f1f03 Enforce that tests building with buildDefault set NO_DEBUG_INFO_TESTCASE
and fix resulting errors. This is a prerequisite for building each
test variant in its own build directory.

llvm-svn: 323789
2018-01-30 17:02:42 +00:00
Adrian Prantl 595048f3ec Wrap all references to build artifacts in the LLDB testsuite (NFC)
in TestBase::getBuildArtifact(). This NFC commit is in preparation for
https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree).

Differential Revision: https://reviews.llvm.org/D42280

llvm-svn: 323007
2018-01-19 23:24:35 +00:00
Jason Molenda 73b76ce563 Mark this as skipped for now. There is a race condition with
SectionLoadList exposed by this test.  Greg tried to chase it down
& got pretty far but the isn't correct so we'll disable this test
for now until I can figure that out.

<rdar://problem/30899227> 

llvm-svn: 297440
2017-03-10 05:33:27 +00:00
Jason Molenda eb0e7cb8de Ah, this was an early exit to leave built products around, it wasn't meant to
be checked in.

llvm-svn: 296412
2017-02-27 23:31:29 +00:00
Jason Molenda 1e7ecd3e64 Fix a race condition in FuncUnwinders where the mutex was being
acquired only after checking if the ivar shared pointer was already
filled in.  But when I assign an UnwindPlan object to the shared
pointer, I assign an empty object and then fill it in.  That leaves
a window where another thread could get the shared pointer to the
empty (but quickly being-filled-in) object and lead to a crash.

Also two changes from Greg for correctness on the TestMultipleDebuggers
test case.

<rdar://problem/30564102> 

llvm-svn: 296084
2017-02-24 03:35:46 +00:00
Kamil Rytarowski ea89913839 Fix multi-process-driver.cpp build on NetBSD
Summary:
Include <string.h> for strcmp(3) and memset(3).

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29403

llvm-svn: 293895
2017-02-02 15:05:56 +00:00
Jim Ingham df1e4b697e Ignore SIGPIPE in the mini-driver used by these tests.
We're seeing some very occasional failures in these tests where the
mini-driver dies with a SIGPIPE.  We don't use SIGPIPE for anything, and
the main lldb driver program already ignores SIGPIPE, so ignoring it in
the mini-driver is a good way to remove these spurious failures.

<rdar://problem/29740488>

llvm-svn: 290216
2016-12-21 00:12:54 +00:00
Pavel Labath d2396b6425 Remove some annotations from TestMultipleTargets
The test passes on linux. The i386 case is already handled by
skipIfHostIncompatibleWithRemote.

llvm-svn: 289427
2016-12-12 11:37:42 +00:00
Greg Clayton 461ba656a5 Fix buildbots that are failing due to this test by adding all expected fails that TestMultipleDebuggers.py has.
llvm-svn: 289223
2016-12-09 16:25:13 +00:00
Greg Clayton 1c4d4d61cb Rename multiple target test so it is unique.
llvm-svn: 289222
2016-12-09 16:22:10 +00:00
Pavel Labath 73ee5c2fc4 Fix TestMultipleTargets for on x86_64 architectures
This test links against liblldb, so it can only run when the target arch is the
same arch as liblldb. We already have a decorator for that, so apply it.

While I'm in there, also mark the test as debug-info independent.

llvm-svn: 289199
2016-12-09 10:05:07 +00:00
Greg Clayton 7904046c33 Calling SBDebugger::CeeateTarget being called on multiple threads was crashing LLDB.
I found the race condition in:

ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create);

More than one "ScriptInterpreter *" was being returned due to the race which caused any clients with the first one to now be pointing to freed memory and we would quickly crash.

Added a test to catch this so we don't regress.

<rdar://problem/28356584> 

llvm-svn: 289169
2016-12-09 01:21:14 +00:00
Pavel Labath d399b10e01 Enable TestMultithreaded-sb_api_listener_event_process_state on linux/gcc
Passing consistently now.

llvm-svn: 287885
2016-11-24 15:10:15 +00:00
Chris Bieneman f8ac2da114 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25887

llvm-svn: 285542
2016-10-31 04:48:19 +00:00
Chris Bieneman 614dc150ec Revert "[Test Suite] Pull generateSource into lldbtest"
This reverts commit r285357.

I committed this patch accidentally out of order. Will recommit when the change this depends on is landed.

llvm-svn: 285361
2016-10-27 23:18:52 +00:00
Chris Bieneman f817bae161 [Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25887

llvm-svn: 285357
2016-10-27 22:52:32 +00:00
Jason Molenda e1489bde3b Reduce the number of simultaneous debug sessions to 10 and remove
the expectedFlakeyDarwin annotation.

I've been running this test in isolation on my macOS Sierra system
and haven't seen a failure in 20-30 runs.  The number of simultaneous
debug sessions that it spins up could be a problem when the testbots
are running under load, so I'm reducing this from 20 simultaneous
debug sessions to see if we can get enough stability to leave this
enabled.

llvm-svn: 281291
2016-09-13 02:45:45 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Pavel Labath e92050f044 Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_state
The test was attempting to backtrace a process after every state change event (including the
"running", and "restarted" ones), which is not a good idea.

llvm-svn: 279512
2016-08-23 12:10:03 +00:00
Ravitheja Addepally b2ba5a5467 Rewriting TestMultithreaded.py to solve flakyness on Linux
Summary:
test_listener_event_process_state checks for Threads
and Frames in the multithreaded_queue. The listener_func has
more computational load, which may be latter executed than the
pop leading to the failure. This patch tries to only check for
frames in listener_func as presence of frames also confirms 
prescence of threads and avoids the second push into the 
multithreaded_queue.

Reviewers: lldb-commits, clayborg, labath

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

llvm-svn: 269168
2016-05-11 09:54:41 +00:00
Jim Ingham 583bbb1dd4 Change over the broadcaster/listener process to hold shared or weak pointers
to each other.  This should remove some infrequent teardown crashes when the
listener is not the debugger's listener.

Processes now need to take a ListenerSP, not a Listener&.

This required changing over the Process plugin class constructors to take a ListenerSP, instead
of a Listener&.   Other than that there should be no functional change.
 
<rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39

llvm-svn: 262863
2016-03-07 21:50:25 +00:00
Zachary Turner 362e06d7ba Remove expectedFailureLinux decorator.
llvm-svn: 260422
2016-02-10 19:53:36 +00:00
Zachary Turner 05021bb2ed Remove skip and xfail decorators for target architecture.
This removes the following decorators:

* skipIfI386
* expectedFailureI386
* expectedFailurex86_64
* skipIfArch
* skipUnlessArch
* skipUnlessI386

And other related decorators.  All code using those decorators
is updated to use expectedFailureAll and skipIf

llvm-svn: 260178
2016-02-09 00:36:34 +00:00
Zachary Turner 4a289a93f7 Remove expectedFailureWindows decorator.
expectedFailureWindows is equivalent to using the general
expectedFailureAll decorator with oslist="windows".  Additionally,
by moving towards these common decorators we can solve the issue
of having to support decorators that can be called with or without
arguments.  Once all decorators are always called with arguments,
and this is enforced by design (because you can't specify the condition
you're decorating for without passing an argument) the implementation
of the decorators can become much simpler

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

llvm-svn: 260134
2016-02-08 19:34:59 +00:00
Zachary Turner 9a1a2946af Move the rest of the tests over to using the new decorator module.
llvm-svn: 259838
2016-02-04 23:04:17 +00:00
Zachary Turner 7a5382de82 Move some of the common decorators to decorators.py.
This doesn't attempt to move every decorator.  The reason for
this is that it requires touching every single test file to import
decorators.py.  I would like to do this in a followup patch, but
in the interest of keeping the patches as bite-sized as possible,
I've only attempted to move the underlying common decorators first.
A few tests call these directly, so those tests are updated as part
of this patch.

llvm-svn: 259807
2016-02-04 18:03:01 +00:00
Pavel Labath f6d9db4ae8 XFAIL TestMultithreaded on linux
Test sometimes fails even during the reruns, upgrading to xflaky to xfail.

llvm-svn: 257068
2016-01-07 15:24:51 +00:00
Pavel Labath b5846ce715 Remove XTIMEOUT from TestMultithreaded on linux
instead, mark the test as expected flaky, which will trigger a rerun in case the test hangs.

llvm-svn: 256935
2016-01-06 14:15:32 +00:00
Tamas Berghammer 0ecdae1bdc Merge ENABLE_THREADS and ENABLE_STD_THREADS markers
Both of these markers are used in the test suit for annotating when a
test needs multi threaded support. Previously they had slightly
different meening but they converged to the point where they are used
interchangably. This CL removes the ENABLE_STD_THREADS one to simplify
the test suite and avoid some confusion.

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

llvm-svn: 255641
2015-12-15 12:11:00 +00:00
Zachary Turner d865c6b707 Remove the -c option from dotest.py.
This seems to be a legacy relic from days gone by where the
remote test suite runner operated completely differently than it
does today.  git blames and comments traced this functionality
back to about 2012, and nobody seems to know anything about it
now.

llvm-svn: 255060
2015-12-08 22:15:48 +00:00
Zachary Turner 606e3a5221 Get rid of global variables in dotest.py
This moves all the global variables into a separate module called
`configuration`.  This has a number of advantages:

1. Configuration data is centrally maintained so it's easy to get
   a high level overview of what configuration data the test suite
   makes use of.
2. The method of sharing configuration data among different parts
   of the test suite becomes standardized.  Previously we would
   put some things into the `lldb` module, some things into the
   `lldbtest_config` module, and some things would not get shared.
   Now everything is shared through one module and is available to
   the entire test suite.
3. It opens the door to moving some of the initialization code into
   the `configuration` module, simplifying the implementation of
   `dotest.py`.

There are a few stragglers that didn't get converted over to using
the `configuration` module in this patch, because it would have grown
the size of the patch unnecessarily.  This includes everything
currently in the `lldbtest_config` module, as well as the
`lldb.remote_platform` variable.  We can address these in the future.

llvm-svn: 254982
2015-12-08 01:15:30 +00:00
Kamil Rytarowski 1f1a15332b getwd(3) with NULL pointer extension is supported on NetBSD
Summary:
The getwd() and getcwd() functions conform to IEEE Std 1003.1-1990
(POSIX.1).  The IEEE Std 1003.1-2004 (POSIX.1) revision marked
getwd() as legacy and recommended the use of getcwd() instead.  The IEEE
Std 1003.1-2008 (``POSIX.1'') revision removed getwd() from the
specification.

The ability to specify a NULL pointer and have getcwd() allocate memory
as necessary is an extension.

The getwd() function appeared in 4.0BSD.

Reviewers: emaste, tfiala, clayborg

Subscribers: lldb-commits, joerg

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

llvm-svn: 254944
2015-12-07 21:21:12 +00:00
Tamas Berghammer a88453b069 Re-add an xfail removed by r254163
The test is flakey but it fails too often with gcc 4.9.2 on x86_64 to
be marked only as expected flakey.

llvm-svn: 254194
2015-11-27 10:50:33 +00:00
Tamas Berghammer e4fbec4a37 Remove some xfail-s fixed by r253026
These tests were fixed by r253026 but they was failing on the linux
build bot because of a system setup problem. Remove xfail from them
after we fixed the build bot.

llvm-svn: 254163
2015-11-26 16:11:57 +00:00
Pavel Labath e57331679d Re-XFAIL two more tests I missed
llvm-svn: 253042
2015-11-13 13:37:53 +00:00
Pavel Labath 3c5ada8136 Re-add XFAILs to two tests
these decorators were two of many removed in r253026. Unlike others, these tests still seem to be
failing...

llvm-svn: 253034
2015-11-13 11:56:09 +00:00
Abhishek Aggarwal be994649b4 Fix to solve Bug 23139 & Bug 23560
Summary:
 - Reason of both bugs:

   1. For the very first frame, Unwinder doesn't check the validity
      of Full UnwindPlan before creating StackFrame from it:

        When 'process launch' command is run after setting a breakpoint
        in inferior, the Unwinder runs and saves only Frame 0 (the frame
        in which breakpoint was set) in thread's StackFrameList i.e.
        m_curr_frames_sp. However, it doesn't check the validity of the
        Full UnwindPlan for this frame by unwinding 2 more frames further.

   2. Unwinder doesn't update the CFA value of Cursor when Full UnwindPlan
      fails and FallBack UnwindPlan succeeds in providing valid CFA values
      for frames:

        Sometimes during unwinding of stack frames, the Full UnwindPlan
        inside the RegisterContextLLDB object may fail to provide valid
        CFA values for these frames. Then the Fallback UnwindPlan is used
        to unwind the frames.

        If the Fallback UnwindPlan succeeds, then it provides a valid new
        CFA value. The RegisterContextLLDB::m_cfa field of Cursor object
        is updated during the Fallback UnwindPlan execution. However,
        UnwindLLDB misses the implementation to update the 'cfa' field
        of this Cursor with this valid new CFA value.

 - This patch fixes both these issues.

 - Remove XFAIL in test files corresponding to these 2 Bugs

Change-Id: I932ea407545ceee2d628f946ecc61a4806d4cc86
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: jingham, lldb-commits, jasonmolenda

Subscribers: lldb-commits, ovyalov, tberghammer

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

llvm-svn: 253026
2015-11-13 10:47:49 +00:00
Zachary Turner 19474e1801 Remove `use_lldb_suite` from the package, and don't import it anymore.
This module was originally intended to be imported by top-level
scripts to be able to find the LLDB packages and third party
libraries.  Packages themselves shouldn't need to import it,
because by the time it gets into the package, the top-level
script should have already done this.  Indeed, it was just
adding the same values to sys.path multiple times, so this
patch is essentially no functional change.

To make sure it doesn't get re-introduced, we also delete the
`use_lldb_suite` module from `lldbsuite/test`, although the
original copy still remains in `lldb/test`

llvm-svn: 251963
2015-11-03 19:20:39 +00:00
Zachary Turner 95c453a221 Tighten up sys.path, and use absolute imports everywhere.
For convenience, we had added the folder that dotest.py was in
to sys.path, so that we could easily write things like
`import lldbutil` from anywhere and any test.  This introduces
a subtle problem when using Python's package system, because when
unittest2 imports a particular test suite, the test suite is detached
from the package.  Thus, writing "import lldbutil" from dotest imports
it as part of the package, and writing the same line from a test
does a fresh import since the importing module was not part of
the same package.

The real way to fix this is to use absolute imports everywhere.  Instead
of writing "import lldbutil", we need to write "import
lldbsuite.test.util".  This patch fixes up that and all other similar
cases, and additionally removes the script directory from sys.path
to ensure that this can't happen again.

llvm-svn: 251886
2015-11-03 02:06:18 +00:00
Zachary Turner c432c8f856 Move lldb/test to lldb/packages/Python/lldbsuite/test.
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
2015-10-28 17:43:26 +00:00