unittests: Add SystemTests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120101 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/System/TimeValue.cpp b/unittests/System/TimeValue.cpp
new file mode 100644
index 0000000..d1da5c1
--- /dev/null
+++ b/unittests/System/TimeValue.cpp
@@ -0,0 +1,23 @@
+//===- 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);
+}
+
+}