Commit Graph

28 Commits

Author SHA1 Message Date
Stefan Granitz 4b7e12f2cf [CMake] LLVM exports utility targets since r350959, so we can use them without standalone-checks now
llvm-svn: 351037
2019-01-14 09:24:50 +00:00
Stefan Granitz cfdbad065e [CMake] Remove dead code and outdated comments
Summary: All of these changes are NOPs.

Reviewers: stella.stamenova, labath, JDevlieghere

Reviewed By: stella.stamenova

Subscribers: mgorny, lldb-commits, #lldb

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

llvm-svn: 350937
2019-01-11 17:51:33 +00:00
Stefan Granitz 1f024fe6a5 [CMake] Fix standalone builds: make dependency to LLVM's `count` conditional
Summary:
In standalone builds of LLDB we currently have no target `count` that tests can depend on. This may be fixed in the future by exporting the target from LLVM similar to targets llvm-config, dsymutil and others.

In-tree build with this patch:
```
    $ ninja -t query tools/lldb/lit/check-lldb-lit
    tools/lldb/lit/check-lldb-lit:
    input: phony
        tools/lldb/lit/CMakeFiles/check-lldb-lit
        bin/FileCheck
        bin/clang
        bin/count
        bin/darwin-debug
        bin/debugserver
        bin/dsymutil
        bin/llc
        bin/lldb
        bin/lldb-mi
        bin/lldb-server
        bin/lldb-test
        bin/llvm-config
        bin/llvm-mc
        bin/llvm-objcopy
        bin/not
        bin/yaml2obj
        lib/liblldb.dylib
        projects/libcxx/lib/cxx
        tools/lldb/unittests/LLDBUnitTests
    outputs:
        tools/lldb/test/check-lldb
        check-lldb-lit
```

Standalone build with this patch:
```
    $ ninja -t query lit/check-lldb-lit
    lit/check-lldb-lit:
    input: phony
        lit/CMakeFiles/check-lldb-lit
        bin/darwin-debug
        bin/debugserver
        bin/lldb
        bin/lldb-mi
        bin/lldb-server
        bin/lldb-test
        lib/liblldb.dylib
        unittests/LLDBUnitTests
    outputs:
        test/check-lldb
        check-lldb-lit
```

Reviewers: davide, aprantl, JDevlieghere, alexshap

Reviewed By: davide

Subscribers: mgorny, lldb-commits, #lldb

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

llvm-svn: 350538
2019-01-07 16:43:04 +00:00
Zachary Turner cb6788d7b3 [build.py] A few general improvements.
This makes -mode=compile support multiple inputs (and hence
multiple outputs).

It also makes the value of -arch for compiling inferiors default
to the architecture that LLDB is built in.  This can still be
overridden however.

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

llvm-svn: 348305
2018-12-04 21:48:27 +00:00
Davide Italiano 8bc4e9403f [Cmake] Add missing dependency to `count`.
llvm-svn: 347578
2018-11-26 17:30:28 +00:00
Zachary Turner 40d95a27a2 Make sure to have lit load the configured site config first.
For the lldb unit test suite, we forgot to add the mapping from
site config to main config, so when it found the main config in
the source tree, it wasn't going and loading the configured version
in the build tree first, so the required properties weren't getting
set up properly.

llvm-svn: 346057
2018-11-03 00:06:37 +00:00
Zachary Turner 66f7b435ed Fix a bug in the lit test suite generation.
I'm not sure why this has to be CMAKE_CURRENT_SOURCE_DIR, but
it causes all kinds of strange cmake generation errors when it's
the binary dir.

llvm-svn: 346035
2018-11-02 19:55:15 +00:00
Zachary Turner b6355cc561 Refactor the lit configuration files
A year or so ago, I re-wrote most of the lit infrastructure in LLVM so
that it wasn't so boilerplate-y. I added lots of common helper type
stuff, simplifed usage patterns, and made the code more elegant and
maintainable.

We migrated to this in LLVM, clang, and lld's lit files, but not in
LLDBs. This started to bite me recently, as the 4 most recent times I
tried to run the lit test suite in LLDB on a fresh checkout the first
thing that would happen is that python would just start crashing with
unhelpful backtraces and I would have to spend time investigating.

You can reproduce this today by doing a fresh cmake generation, doing
ninja lldb and then python bin/llvm-lit.py -sv ~/lldb/lit/SymbolFile at
which point you'll get a segfault that tells you nothing about what your
problem is.

I started trying to fix the issues with bandaids, but it became clear
that the proper solution was to just bring in the work I did in the rest
of the projects. The side benefit of this is that the lit configuration
files become much cleaner and more understandable as a result.

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

llvm-svn: 346008
2018-11-02 17:49:01 +00:00
Tatyana Krasnukha af2c73e13d Add dependency on llc required by find-variable-dwo test
llvm-svn: 342733
2018-09-21 13:40:22 +00:00
Jonas Devlieghere 4ab5731973 [CMake] Have check-lldb-unit use CMAKE_CURRENT_BINARY_DIR
llvm-lit uses `map_config` directives (generated at configuration-time) to
make it possible to pass a test path relative to the source instead of
the build folder (CMAKE_CURRENT_BINARY_DIR).

However, this doesn't work in the case of swift where the build
directory layout prevents llvm-lit from knowing about lldb and its test
paths. This caused check-lldb-unit to fail in this configuration, while
everything was working as expected upstream. This patch fixes the issue
by passing a path relative to the build directory. This was already the
case for check-lldb-lit.

llvm-svn: 337291
2018-07-17 15:11:15 +00:00
Michal Gorny 6dde836844 [lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON
Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is
enabled.  Otherwise, those tests simply fail being unable to import lldb
module.

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

llvm-svn: 334080
2018-06-06 09:44:14 +00:00
Jonas Devlieghere 52721286b2 [CMake] Unify and relayer testing
This patch restructures part of LLDB's testing configuration:

1. I moved the test dependencies up the chain so every dotest dependency
   becomes a lit dependency as well. It wouldn't make sense for dotest to
   have other dependencies when it's being run by lit. Lit on the other
   hand can still specify extra dependencies.

2. I replaced as much generator expressions with variables as possible.
   This is consistent with the rest of LLVM and doesn't break generators
   that support multiple targets (MSVC, Xcode). This wasn't a problem
   before, but now we need to expand the dotest arguments in the lit
   configuration and there's only one test suite even with multiple
   targets.

3. I moved lldb-dotest into it's own directory under utils since there's
   no need anymore for it to located under `test/`.

Differential revision: https://reviews.llvm.org/D46334

llvm-svn: 331463
2018-05-03 16:54:10 +00:00
Pavel Labath 90b0a53499 lldb-test symbols: Add ability to do name-based lookup
Summary:
lldb-test already had the ability to dump all symbol information in a
module. This is interesting, but it can be too verbose, and it also does
not use the same APIs that lldb uses to query symbol information. The
last part is interesting to me now, because I am about to add DWARF v5
debug_names support, which needs to implement these APIs.

This patch adds a set of arguments to lldb-test, which modify it's
behavior from dumping all symbols to dumping only the requested
information:
- --find={function,namespace,type,variable} - search for the given
  kind of objects.

- --name - the name to search for.

- --regex - whether to treat the "name" as a regular expression. This is
  not available for all lookup types (we do not have the required APIs
  for namespaces and types).

- --context - specifies the context, which can be used to restrict the
  search. This argument takes a variable name (which must be defined and
  be unique), and we then use the context that this variable is defined
  in as the search context.

- --function-flags={auto,full,base,method,selector} - a set of flags to
  further restrict the search for function symbols.

Together, these flags and their combinations cover the main SymbolFile
entry points which I will need to modify for the accelerator table
support, and so I plan to do most of the regression testing this way.
(I've also found this a useful tool for exploration of what the given
APIs are supposed to do.)

I add a couple of tests to demonstrate the usage of the usage of the
various options, and also an xfailed test which demonstrates a bug I
found while playing with this. The only requirement for these tests is
the presence of lld -- the should run on any platform which is able to
build lldb.

These tests use c++ code as input, but this isn't a requirement. It is also
possible to use IR, assembly or json to create the test module.

Reviewers: davide, zturner, asmith, JDevlieghere, clayborg, alexshap

Subscribers: mgorny, aprantl, lldb-commits

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

llvm-svn: 331447
2018-05-03 10:57:16 +00:00
Davide Italiano e8643a0c91 [CMake] Add the missing `dsymutil` dependency when running tests.
llvm-svn: 330617
2018-04-23 17:06:55 +00:00
Davide Italiano 65c3ccc65a [lit] `llvm-mc` is now a dependency to run tests.
llvm-svn: 327350
2018-03-12 23:42:37 +00:00
Davide Italiano c0311fe19b [lldbtestsuite] llvm-objcopy is now required to run the lit tests.
There's now a test using llvm-objcopy in lit/.
This doesn't fail on the bot(s) because `llvm-objcopy` is probably
already available there, but if you get a fresh checkout and run
`ninja check-lldb` you'll observe the failure as it's not tracking
the dependency correctly. This fixes the problem on my machine,
and probably everywhere else.

llvm-svn: 326919
2018-03-07 18:06:12 +00:00
Davide Italiano fb92f4e4c4 [testsuite] Run lit tests as part of `check-lldb`.
Also, fix a missing dependency, as lit requires llvm-config
to run. This is becoming more and more important as we
write more FileCheck style tests.

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

llvm-svn: 325719
2018-02-21 21:10:44 +00:00
Aaron Smith 07482d32e7 [lit] Update how clang and other binaries are found in per-configuration directories
Summary:
This is modeled after the clang and llvm lit tests.

Several properties have CMAKE_CFG_INTDIR as part of the path - this works correctly when the cmake generator only supports one configuration which is known at configuration time, but it does not work correctly when the cmake generator supports multiple configurations (for example, VS). 

For VS, CMAKE_CFG_INTDIR ends up set as $Configuration and then it is never updated correctly. Instead, the lit configuration can use a property that can be overwritten at run time. AddLLVM does that for several properties (such as LLVM_TOOLS_DIR). 

This change is also removing properties from the lit/CMakeLists.txt that are actually set during the call to configure_lit_site_cfg

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits, labath, stella.stamenova, mgorny, hintonda

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

llvm-svn: 325652
2018-02-21 00:05:51 +00:00
Michal Gorny c5e0b63e56 [test] Fix tests to use more portable LLVM_ENABLE_ZLIB
The HAVE_LIBZ variable is not exported by LLVM, and therefore is not
available in stand-alone builds of other tools. Use LLVM_ENABLE_ZLIB
which is the name under which the effective value is exported.

Additional, use llvm_canonicalize_cmake_booleans() to make sure that
a correct (Python-safe) boolean value is passed down to lit.

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

llvm-svn: 322081
2018-01-09 14:44:04 +00:00
Pavel Labath e2867bc4a0 ObjectFileELF: Add support for compressed sections
Summary:
We use the llvm decompressor to decompress SHF_COMPRESSED sections. This enables
us to read data from debug info sections, which are sometimes compressed,
particuarly in the split-dwarf case.  This functionality is only available if
llvm is compiled with zlib support.

Reviewers: clayborg, zturner

Subscribers: emaste, mgorny, aprantl, lldb-commits

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

llvm-svn: 320813
2017-12-15 14:23:58 +00:00
Davide Italiano 4ab13cda81 [CMake] Build clang as dependency when using in-tree clang for tests.
Discussed with Zachary Turner and Pavel Labath on lldb-dev.
Let's hope this doesn't break anything :)

llvm-svn: 316800
2017-10-27 21:22:57 +00:00
Pavel Labath 7e17fc5e09 Default to using in-tree clang for building test executables
Summary:
Using the in-tree clang should be the default test configuration as that
is the one compiler that we can be sure everyone has (better
reproducibility of test results). Also, it should hopefully reduce the
impact of pr35040.

This also reduces the number of settings which control the compiler
used. LLDB_TEST_C_COMPILER is used for C files and
LLDB_TEST_CXX_COMPILER for C++ files. Both of the settings default to
the in-tree clang.

Reviewers: zturner

Subscribers: mgorny, davide, lldb-commits

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

llvm-svn: 316728
2017-10-27 02:24:04 +00:00
Chris Bieneman 1bd5f52e68 [CMake] Fix standalone build
not and FileCheck targets may not be defined in standalone builds.

llvm-svn: 284854
2016-10-21 18:38:44 +00:00
Zachary Turner e13ffee009 [cmake] Don't depend on lldb-server unless it's built.
llvm-svn: 281661
2016-09-15 21:32:51 +00:00
Chris Bieneman 3045d703f6 Fixing bot failures
Need to only add debugserver as a test dependency on Darwin.

llvm-svn: 281652
2016-09-15 20:23:31 +00:00
Chris Bieneman 4851558f55 [LIT] First pass of LLDB LIT support
Summary:
This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT.

With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB.

The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used.

The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories.

The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows.

Reviewers: zturner, labath, jingham, tfiala

Subscribers: beanz, mgorny, lldb-commits

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

llvm-svn: 281651
2016-09-15 20:13:55 +00:00
Zachary Turner d79bc32668 Rename MSVC top-level folder to avoid name collision.
If you have two folders with the same name but different cases,
MSBuild gets confused and generates an error when building
from within Visual Studio.

This patch renames it so that the cases of all folders named
"LLDB tests" match.

Patch by Jonathan Meier
Differential Revision: http://reviews.llvm.org/D16150

llvm-svn: 257684
2016-01-13 22:00:44 +00:00
Zachary Turner 891af04d82 Create a check-lldb-unit target to run unit tests.
llvm-svn: 232212
2015-03-13 20:55:07 +00:00