Commit Graph

26 Commits

Author SHA1 Message Date
Raphael Isemann a52a11139c [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()'
Summary:
A lot of tests do this trick but the vast majority of them don't even call `print()`.

Most of this patch was generated by a script that just looks at all the files and deletes the line if there is no `print (` or `print(` anywhere else in the file.
I checked the remaining tests manually and deleted the import if we never call print (but instead do stuff like `expr print(...)` and similar false-positives).
I also corrected the additional empty lines after the import in the files that I manually edited.

Reviewers: JDevlieghere, labath, jfb

Reviewed By: labath

Subscribers: dexonsmith, wuzish, nemanjai, kbarton, christof, arphaman, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71452
2019-12-13 12:23:04 +01:00
Fred Riss 42beb8ed79 TestBatchMode.py: add missing @skipIfRemote
All the tests in this file were already marked as skipped for remote tests
except for this one.
2019-11-05 12:22:59 -08:00
Tatyana Krasnukha a11668e87b Don't stop execution in batch mode when process stops with SIGINT or SIGSTOP
Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms.

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

llvm-svn: 372961
2019-09-26 10:57:11 +00:00
Pavel Labath 45e3ce8d76 [dotest] Centralize initialization commands even more
Summary:
In r367234 we introduced a central place to hold the set up commands for
the various ways we have of launching lldb. However, a number of
commands still remained outside of that.

This patch moves the remaining set up commands into this function, which
allows us to remove manual clang module path setting code in
TestBatchMode.

One unfortunate victim of this approach is TestSTTYBeforeAndAfter which,
due to how it launches lldb (pexpect->expect->lldb), fails get the
quoting right. It would be possible to fix the quoting there, it would be a bit
icky, and none of the commands in this list are really relevant for what this
test is doing, so I just remove the commands outright.

Reviewers: JDevlieghere, jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 371019
2019-09-05 07:35:45 +00:00
Pavel Labath 84542187ee Port TestBatchMode to PExpectTest class
Summary:
I'm doing this mainly for consistency, but there are also other cleanups
that will be enabled by this (e.g., the automatic setting of
clang-modules-cache-path setting).

Reviewers: teemperor, JDevlieghere

Subscribers: lldb-commits

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

llvm-svn: 370858
2019-09-04 09:20:08 +00:00
Pavel Labath 418a272f4a [dotest] Avoid the need for LEVEL= makefile boilerplate
Summary:
Instead of each test case knowing its depth relative to the test root,
we can just have dotest add the folder containing Makefile.rules to the
include path.

This was motivated by r370616, though I have been wanting to do this
ever since we moved to building tests out-of-tree.

The only manually modified files in this patch are lldbinline.py and
plugins/builder_base.py. The rest of the patch has been produced by this
shell command:
  find . \( -name Makefile -o -name '*.mk' \)  -exec sed --in-place -e '/LEVEL *:\?=/d' -e '1,2{/^$/d}' -e 's,\$(LEVEL)/,,' {} +

Reviewers: teemperor, aprantl, espindola, jfb

Subscribers: emaste, javed.absar, arichardson, christof, arphaman, lldb-commits

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

llvm-svn: 370845
2019-09-04 07:46:25 +00:00
Raphael Isemann 9eedbc4f26 [lldb][NFC] Remove unused imports in python tests
llvm-svn: 367663
2019-08-02 08:06:22 +00:00
Davide Italiano 0b29af0f7c [TestBatchMode] We already log this output to a file.
llvm-svn: 356003
2019-03-13 02:47:51 +00:00
Adrian Prantl 97f51c95db Fix the broken Batch test by passing a custom module cache to the inferior lldb.
llvm-svn: 355991
2019-03-12 22:20:29 +00:00
Adrian Prantl df85147707 Revert "Temporarily add more logging to TestBatchMode"
llvm-svn: 355990
2019-03-12 22:20:26 +00:00
Adrian Prantl 8ef3da494c Temporarily add more logging to TestBatchMode
llvm-svn: 355986
2019-03-12 21:30:50 +00:00
Michal Gorny de11105d2e [lldb] [test] Mark failing tests XFAIL on NetBSD
Add a convenience 'expectedFailureNetBSD' decorator and mark all tests
currently failing on NetBSD with it.  Also skip a few tests that hang
the test suite.  This should establish a baseline for the test suite
and get us closer to enabling tests on buildbot.  This will help us
catch regressions while we still have a lot of work to do to get tests
working.

It seems that there are also some flaky tests.  I am going to address
them later on.

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

llvm-svn: 355320
2019-03-04 16:54:06 +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
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
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
Pavel Labath d0f89cd721 Centralize the handling of attach permissions on linux in tests
Summary:
On linux we need the process to give us special permissions before we can attach to it.
Previously, the code for this was copied into every file that needed it. This moves the code to a
central place to reduce code duplication.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 257319
2016-01-11 10:24:50 +00:00
Jim Ingham 58a305bf15 Fiddling with Pavel's fix for getting the breakpoint right when there's debug info for sleep.
I prefer to use "-p" over using line_number and then setting by line because it's makes it possible
to see what the breakpoint is at the site where you make the breakpoint.  So I switched
it back to -p but specified the source file as well, which is an "all within lldb" way of doing
what Pavel's fix did.

llvm-svn: 257235
2016-01-09 00:08:16 +00:00
Pavel Labath 0573159b84 Fix TestBatchMode for gcc
gcc by default does not accept for loop declarations in C files (one must choose C99 mode first,
which we don't). Place the declaration outside the loop, to make this code more conformant.

llvm-svn: 257166
2016-01-08 11:23:21 +00:00
Pavel Labath fa42a83773 Another fix for TestBatchMode on linux
On locked down systems (such as our buildbot) one needs to do a special dance to allow attaching
to processes. This commit adds this code to the TestBatchMode inferior.

llvm-svn: 257165
2016-01-08 11:16:45 +00:00
Pavel Labath eceec6dd01 Fix TestBatchMode on linux
New test introduced in r257120 was failing on linux. The reason for that the regex for setting
the breakpoint was being applied to the "default file", which in this case was the asm file
containing the definition of the sleep() syscall (because after attach, we are stopped in the
sleep function). I have changed this use the more customary way of setting the breakpoint and
specifying the source file name explicitly.

llvm-svn: 257160
2016-01-08 10:38:20 +00:00
Jim Ingham 962260c852 Fix a glitch in the Driver's batch mode when used with "attach".
Batch mode is supposed to stop execution and return control to the user when an
exceptional stop occurs (crash, signal or instrumentation).  But attach always stops
with a SIGSTOP on OSX (maybe on Linux too?) which would short circuit the rest of the
commands given.

This change allows a command result object to indicate that it expected to leave the 
process stopped with an exceptional stop reason, and it is okay for batch mode to keep going.

<rdar://problem/22243143>

llvm-svn: 257120
2016-01-08 00:20:47 +00:00
Ed Maste 43bd918475 Add expectedFlakeyFreeBSD to TestBatchMode failing on buildbot
This test was already expectedFlakeyLinux for occasional failures on the
Linux buildbot. It seems the new FreeBSD buildbot fails the same way on
occasion.

llvm.org/pr25172

llvm-svn: 254002
2015-11-24 18:34:17 +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