diff options
| author | Pavel Labath <labath@google.com> | 2017-03-29 21:01:14 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-03-29 21:01:14 +0000 |
| commit | 01a28ca7f8f0999527ffa2d86f6e77b374ef1ed6 (patch) | |
| tree | 3231941a45c8d56f0cb2c56c86d5772798a7a5d8 /lldb/packages/Python/lldbsuite/test/functionalities | |
| parent | 32093a1c28250bc08a8b69d63aa91c358f7d42fb (diff) | |
| download | bcm5719-llvm-01a28ca7f8f0999527ffa2d86f6e77b374ef1ed6.tar.gz bcm5719-llvm-01a28ca7f8f0999527ffa2d86f6e77b374ef1ed6.zip | |
Centralize libc++ test skipping logic
Summary:
This aims to replace the different decorators we've had on each libc++
test with a single solution. Each libc++ will be assigned to the
"libc++" category and a single central piece of code will decide whether
we are actually able to run libc++ test in the given configuration by
enabling or disabling the category (while giving the user the
opportunity to override this).
I started this effort because I wanted to get libc++ tests running on
android, and none of the existing decorators worked for this use case:
- skipIfGcc - incorrect, we can build libc++ executables on android
with gcc (in fact, after this, we can now do it on linux as well)
- lldbutil.skip_if_library_missing - this checks whether libc++.so is
loaded in the proces, which fails in case of a statically linked
libc++ (this makes copying executables to the remote target easier to
manage).
To make this work I needed to split out the pseudo_barrier code from the
force-included file, as libc++'s atomic does not play well with gcc on
linux, and this made every test fail, even though we need the code only
in the threading tests.
So far, I am only annotating one of the tests with this category. If
this does not break anything, I'll proceed to update the rest.
Reviewers: jingham, zturner, EricWF
Subscribers: srhines, lldb-commits
Differential Revision: https://reviews.llvm.org/D30984
llvm-svn: 299028
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities')
11 files changed, 26 insertions, 26 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py index b0e84121dde..5b9b14d549e 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py @@ -23,9 +23,10 @@ class LibcxxStringDataFormatterTestCase(TestBase): TestBase.setUp(self) # Find the line number to break at. self.line = line_number('main.cpp', '// Set break point at this line.') + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' - @skipIf(compiler="gcc") - @skipIfWindows # libc++ not ported to Windows yet + @add_test_categories(["libc++"]) def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() @@ -36,9 +37,6 @@ class LibcxxStringDataFormatterTestCase(TestBase): self.runCmd("run", RUN_SUCCEEDED) - lldbutil.skip_if_library_missing( - self, self.target(), lldbutil.PrintableRegex("libc\+\+")) - # The stop reason of the thread should be breakpoint. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['stopped', @@ -58,17 +56,18 @@ class LibcxxStringDataFormatterTestCase(TestBase): # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) + ns = self.namespace self.expect( "frame variable", substrs=[ - '(std::__1::wstring) s = L"hello world! מזל טוב!"', - '(std::__1::wstring) S = L"!!!!"', + '(%s::wstring) s = L"hello world! מזל טוב!"'%ns, + '(%s::wstring) S = L"!!!!"'%ns, '(const wchar_t *) mazeltov = 0x', 'L"מזל טוב"', - '(std::__1::string) q = "hello world"', - '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"', - '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"', - '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"']) + '(%s::string) q = "hello world"'%ns, + '(%s::string) Q = "quite a long std::strin with lots of info inside it"'%ns, + '(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"'%ns, + '(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'%ns]) self.runCmd("n") @@ -91,11 +90,11 @@ class LibcxxStringDataFormatterTestCase(TestBase): self.expect( "frame variable", substrs=[ - '(std::__1::wstring) s = L"hello world! מזל טוב!"', - '(std::__1::wstring) S = L"!!!!!"', + '(%s::wstring) s = L"hello world! מזל טוב!"'%ns, + '(%s::wstring) S = L"!!!!!"'%ns, '(const wchar_t *) mazeltov = 0x', 'L"מזל טוב"', - '(std::__1::string) q = "hello world"', - '(std::__1::string) Q = "quite a long std::strin with lots of info inside it"', - '(std::__1::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"', - '(std::__1::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"']) + '(%s::string) q = "hello world"'%ns, + '(%s::string) Q = "quite a long std::strin with lots of info inside it"'%ns, + '(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"'%ns, + '(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'%ns]) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp index 9908faffb6e..f53ce2f3592 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/main.cpp @@ -9,7 +9,7 @@ // This test verifies the correct handling of child thread exits. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> #include <csignal> diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp index 826d9d3fa97..7e09662edb2 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/main.cpp @@ -9,7 +9,7 @@ // This test verifies the correct handling of child thread exits. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> #include <csignal> diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp index f9f33fda82b..f06761936d1 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/main.cpp @@ -13,7 +13,7 @@ // breakpoint is hit. The test case should be flexible enough to treat that // as success. -#include <atomic> +#include "pseudo_barrier.h" #include <chrono> #include <thread> diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp index 10b55bff3ba..540b5148aef 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp @@ -13,7 +13,7 @@ // the main thread (before any worker threads are spawned) and modify variables // which control the number of threads that are spawned for each action. -#include <atomic> +#include "pseudo_barrier.h" #include <vector> using namespace std; diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp index 70681fd1160..f927e3d9d49 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/main.cpp @@ -10,7 +10,7 @@ // This test is intended to create a situation in which one thread will be // created while the debugger is stepping in another thread. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> #define do_nothing() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp index a032da835ea..e41fbebf380 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp @@ -13,7 +13,7 @@ // breakpoint is hit. The test case should be flexible enough to treat that // as success. -#include <atomic> +#include "pseudo_barrier.h" #include <chrono> #include <thread> diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp index 45adf28ce81..c7affd2a59a 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/main.cpp @@ -10,6 +10,7 @@ // This test is intended to create a situation in which one thread will exit // while the debugger is stepping in another thread. +#include "pseudo_barrier.h" #include <thread> #define do_nothing() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp index c3d695dbc74..d46038109fc 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/main.cpp @@ -12,7 +12,7 @@ // the breakpoint in the second thread will be hit while the breakpoint handler // in the first thread is trying to stop all threads. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> pseudo_barrier_t g_barrier; diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp index 31f9a1576b9..ecc0571f2bd 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/main.cpp @@ -10,7 +10,7 @@ // This test is intended to create a situation in which two threads are stopped // at a breakpoint and the debugger issues a step-out command. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> pseudo_barrier_t g_barrier; diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp index c57db9f4852..f9508cf6ecc 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp @@ -9,7 +9,7 @@ // This test verifies the correct handling of child thread exits. -#include <atomic> +#include "pseudo_barrier.h" #include <thread> pseudo_barrier_t g_barrier1; |

