summaryrefslogtreecommitdiff
path: root/lib/Testing/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Testing/Support')
-rw-r--r--lib/Testing/Support/CMakeLists.txt12
-rw-r--r--lib/Testing/Support/Error.cpp22
-rw-r--r--lib/Testing/Support/LLVMBuild.txt22
3 files changed, 56 insertions, 0 deletions
diff --git a/lib/Testing/Support/CMakeLists.txt b/lib/Testing/Support/CMakeLists.txt
new file mode 100644
index 000000000000..fa8dfe59c8bd
--- /dev/null
+++ b/lib/Testing/Support/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_llvm_library(LLVMTestingSupport
+ Error.cpp
+
+ BUILDTREE_ONLY
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLVM_MAIN_INCLUDE_DIR}/llvm/Testing/Support
+ )
+
+include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
+include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
+target_link_libraries(LLVMTestingSupport PRIVATE gtest) \ No newline at end of file
diff --git a/lib/Testing/Support/Error.cpp b/lib/Testing/Support/Error.cpp
new file mode 100644
index 000000000000..ce0da44da408
--- /dev/null
+++ b/lib/Testing/Support/Error.cpp
@@ -0,0 +1,22 @@
+//===- llvm/Testing/Support/Error.cpp -------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Testing/Support/Error.h"
+
+#include "llvm/ADT/StringRef.h"
+
+using namespace llvm;
+
+llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) {
+ bool Succeeded = !static_cast<bool>(Err);
+ std::string Message;
+ if (!Succeeded)
+ Message = toString(std::move(Err));
+ return {Succeeded, Message};
+}
diff --git a/lib/Testing/Support/LLVMBuild.txt b/lib/Testing/Support/LLVMBuild.txt
new file mode 100644
index 000000000000..40853e8172d5
--- /dev/null
+++ b/lib/Testing/Support/LLVMBuild.txt
@@ -0,0 +1,22 @@
+;===- ./Testing/Support/LLVMBuild.txt --------------------------*- Conf -*--===;
+;
+; The LLVM Compiler Infrastructure
+;
+; This file is distributed under the University of Illinois Open Source
+; License. See LICENSE.TXT for details.
+;
+;===------------------------------------------------------------------------===;
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;
+; http://llvm.org/docs/LLVMBuild.html
+;
+;===------------------------------------------------------------------------===;
+
+[component_0]
+type = Library
+name = TestingSupport
+parent = Libraries
+required_libraries = Support