summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-10-27 22:52:32 +0000
committerChris Bieneman <beanz@apple.com>2016-10-27 22:52:32 +0000
commitf817bae1616852aeae880aa8e6a22407276aa223 (patch)
treea11307e419851e4fddf18aff7ce1068091abaab8 /lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
parent91967bd301cba2185b612b9b686cb7367383a00e (diff)
downloadbcm5719-llvm-f817bae1616852aeae880aa8e6a22407276aa223.tar.gz
bcm5719-llvm-f817bae1616852aeae880aa8e6a22407276aa223.zip
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template')
-rw-r--r--lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template38
1 files changed, 38 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template b/lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
new file mode 100644
index 00000000000..adb1d200655
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
@@ -0,0 +1,38 @@
+
+/// LLDB C API Test Driver
+
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+#include <string>
+#include <vector>
+
+%include_SB_APIs%
+
+#include "common.h"
+
+using namespace std;
+using namespace lldb;
+
+void test(SBDebugger &dbg, std::vector<string> args);
+
+int main(int argc, char** argv) {
+ int code = 0;
+
+ SBDebugger::Initialize();
+ SBDebugger dbg = SBDebugger::Create();
+
+ try {
+ if (!dbg.IsValid())
+ throw Exception("invalid debugger");
+ vector<string> args(argv + 1, argv + argc);
+
+ test(dbg, args);
+ } catch (Exception &e) {
+ cout << "ERROR: " << e.what() << endl;
+ code = 1;
+ }
+
+ SBDebugger::Destroy(dbg);
+ return code;
+}
OpenPOWER on IntegriCloud