diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
commit | 22314179f0660c172514b397060fd8f34b586e82 (patch) | |
tree | afb3f04cd285733772ffceec4ccf3d8539dca91c /lldb/test/Shell/Reproducer/Modules | |
parent | df14bd315db94d286c0c75b4b6ee5d760f311399 (diff) | |
download | bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.tar.gz bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.zip |
[test] Split LLDB tests into API, Shell & Unit
LLDB has three major testing strategies: unit tests, tests that exercise
the SB API though dotest.py and what we currently call lit tests. The
later is rather confusing as we're now using lit as the driver for all
three types of tests. As most of this grew organically, the directory
structure in the LLDB repository doesn't really make this clear.
The 'lit' tests are part of the root and among these tests there's a
Unit and Suite folder for the unit and dotest-tests. This layout makes
it impossible to run just the lit tests.
This patch changes the directory layout to match the 3 testing
strategies, each with their own directory and their own configuration
file. This means there are now 3 directories under lit with 3
corresponding targets:
- API (check-lldb-api): Test exercising the SB API.
- Shell (check-lldb-shell): Test exercising command line utilities.
- Unit (check-lldb-unit): Unit tests.
Finally, there's still the `check-lldb` target that runs all three test
suites.
Finally, this also renames the lit folder to `test` to match the LLVM
repository layout.
Differential revision: https://reviews.llvm.org/D68606
llvm-svn: 374184
Diffstat (limited to 'lldb/test/Shell/Reproducer/Modules')
6 files changed, 63 insertions, 0 deletions
diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h new file mode 100644 index 00000000000..d004baf3168 --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h @@ -0,0 +1,3 @@ +struct Bar { + int success; +}; diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h new file mode 100644 index 00000000000..1fe02e89786 --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h @@ -0,0 +1 @@ +struct Foo {}; diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in b/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in new file mode 100644 index 00000000000..0f5bb7864f2 --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in @@ -0,0 +1,6 @@ +breakpoint set -f main.cpp -l 5 +run +expr -l Objective-C++ -- @import Foo +expr -l Objective-C++ -- @import Bar +expr -- Bar() +reproducer generate diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp b/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp new file mode 100644 index 00000000000..e6a331bb405 --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp @@ -0,0 +1,9 @@ +#include "Foo.h" + +void stop() {} + +int main(int argc, char **argv) { + Foo foo; + stop(); // break here. + return 0; +} diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap b/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap new file mode 100644 index 00000000000..4221d0f9134 --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap @@ -0,0 +1,7 @@ +module Foo { + header "Foo.h" +} + +module Bar { + header "Bar.h" +} diff --git a/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test new file mode 100644 index 00000000000..843c7e6d1ff --- /dev/null +++ b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test @@ -0,0 +1,37 @@ +# REQUIRES: system-darwin + +# Start fresh. +# RUN: rm -rf %t.repro +# RUN: rm -rf %t.root +# RUN: rm -rf %t.clang-cache +# RUN: rm -rf %t.lldb-cache + +# Create a temporary root we can remove later. +# RUN: mkdir -p %t.root +# RUN: mkdir -p %t.clang-cache +# RUN: mkdir -p %t.lldb-cache +# RUN: cp %S/Inputs/main.cpp %t.root +# RUN: cp %S/Inputs/Foo.h %t.root +# RUN: cp %S/Inputs/Bar.h %t.root +# RUN: cp %S/Inputs/module.modulemap %t.root + +# Compile the test case form the temporary root. +# RUN: %clang %t.root/main.cpp -g -fmodules -fcxx-modules -fmodules-cache-path=%t.clang-cache -o %t.root/a.out + +# Capture the debug session. +# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --capture --capture-path %t.repro %t.root/a.out | FileCheck %s --check-prefix CAPTURE +# CAPTURE: (success = 0) + +# RUN: cat %t.repro/files.yaml | FileCheck %s --check-prefix YAML +# YAML-DAG: Foo.h +# YAML-DAG: Bar.h +# YAML-DAG: module.modulemap + +# Remove the temporary root. +# RUN: rm -rf %t.root +# RUN: rm -rf %t.clang-cache +# RUN: rm -rf %t.lldb-cache + +# Replay the debug session. +# RUN: %lldb -x -b -o 'settings set symbols.clang-modules-cache-path %t.lldb-cache' -s %S/Inputs/ModuleCXX.in --replay %t.repro %t.root/a.out | FileCheck %s --check-prefix REPLAY +# REPLAY: (success = 0) |