include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
add_definitions(-DGTEST_HAS_RTTI=0)
+if (NOT LLVM_ENABLE_THREADS)
+ add_definitions(-DGTEST_HAS_PTHREAD=0)
+endif()
set(LLVM_LINK_COMPONENTS
jit
set(LLVM_USED_LIBS
gtest
gtest_main
+ LLVMSupport # gtest needs it for raw_ostream.
)
add_llvm_unittest(ADT
Support/raw_ostream_test.cpp
Support/RegexTest.cpp
Support/SwapByteOrderTest.cpp
- Support/System.cpp
Support/TypeBuilderTest.cpp
Support/ValueHandleTest.cpp
)
+
+set(LLVM_LINK_COMPONENTS
+ System
+ )
+
+add_llvm_unittest(System
+ System/Path.cpp
+ System/TimeValue.cpp
+ )
LEVEL = ..
-PARALLEL_DIRS = ADT ExecutionEngine Support Transforms VMCore Analysis
+PARALLEL_DIRS = ADT ExecutionEngine Support System Transforms VMCore Analysis
include $(LEVEL)/Makefile.common
+++ /dev/null
-//===- llvm/unittest/Support/System.cpp - System tests --===//
-#include "gtest/gtest.h"
-#include "llvm/System/TimeValue.h"
-#include <time.h>
-
-using namespace llvm;
-namespace {
-class SystemTest : public ::testing::Test {
-};
-
-TEST_F(SystemTest, TimeValue) {
- sys::TimeValue now = sys::TimeValue::now();
- time_t now_t = time(NULL);
- EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);
-}
-}
--- /dev/null
+##===- unittests/System/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../..
+TESTNAME = System
+LINK_COMPONENTS := system
+
+include $(LEVEL)/Makefile.config
+include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
--- /dev/null
+//===- llvm/unittest/System/Path.cpp - Path tests -------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+namespace {
+
+TEST(System, Path) {
+ // TODO: Add tests!
+}
+
+} // anonymous namespace
--- /dev/null
+//===- llvm/unittest/System/TimeValue.cpp - Time Vlaue tests --------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "llvm/System/TimeValue.h"
+#include <time.h>
+
+using namespace llvm;
+namespace {
+
+TEST(System, TimeValue) {
+ sys::TimeValue now = sys::TimeValue::now();
+ time_t now_t = time(NULL);
+ EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);
+}
+
+}