[llvm-commits] [llvm] r120330 - in /llvm/trunk/unittests: CMakeLists.txt Support/Path.cpp Support/TimeValue.cpp System/Makefile System/Path.cpp System/TimeValue.cpp

Michael J. Spencer bigcheesegs at gmail.com
Mon Nov 29 14:29:04 PST 2010


Author: mspencer
Date: Mon Nov 29 16:29:04 2010
New Revision: 120330

URL: http://llvm.org/viewvc/llvm-project?rev=120330&view=rev
Log:
unittests: Merge SystemTests back into SupportTests.

Added:
    llvm/trunk/unittests/Support/Path.cpp
      - copied, changed from r120329, llvm/trunk/unittests/System/Path.cpp
    llvm/trunk/unittests/Support/TimeValue.cpp
      - copied, changed from r120329, llvm/trunk/unittests/System/TimeValue.cpp
Removed:
    llvm/trunk/unittests/System/Makefile
    llvm/trunk/unittests/System/Path.cpp
    llvm/trunk/unittests/System/TimeValue.cpp
Modified:
    llvm/trunk/unittests/CMakeLists.txt

Modified: llvm/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=120330&r1=120329&r2=120330&view=diff
==============================================================================
--- llvm/trunk/unittests/CMakeLists.txt (original)
+++ llvm/trunk/unittests/CMakeLists.txt Mon Nov 29 16:29:04 2010
@@ -120,18 +120,11 @@
   Support/EndianTest.cpp
   Support/LeakDetectorTest.cpp
   Support/MathExtrasTest.cpp
+  Support/Path.cpp
   Support/raw_ostream_test.cpp
   Support/RegexTest.cpp
   Support/SwapByteOrderTest.cpp
+  Support/TimeValue.cpp
   Support/TypeBuilderTest.cpp
   Support/ValueHandleTest.cpp
   )
-
-set(LLVM_LINK_COMPONENTS
-  Support
-  )
-
-add_llvm_unittest(System
-  System/Path.cpp
-  System/TimeValue.cpp
-  )

Copied: llvm/trunk/unittests/Support/Path.cpp (from r120329, llvm/trunk/unittests/System/Path.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?p2=llvm/trunk/unittests/Support/Path.cpp&p1=llvm/trunk/unittests/System/Path.cpp&r1=120329&r2=120330&rev=120330&view=diff
==============================================================================
--- llvm/trunk/unittests/System/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Mon Nov 29 16:29:04 2010
@@ -1,4 +1,4 @@
-//===- llvm/unittest/System/Path.cpp - Path tests -------------------------===//
+//===- llvm/unittest/Support/Path.cpp - Path tests ------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -15,7 +15,7 @@
 
 namespace {
 
-TEST(System, Path) {
+TEST(Support, Path) {
   SmallVector<StringRef, 40> paths;
   paths.push_back("");
   paths.push_back(".");

Copied: llvm/trunk/unittests/Support/TimeValue.cpp (from r120329, llvm/trunk/unittests/System/TimeValue.cpp)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/TimeValue.cpp?p2=llvm/trunk/unittests/Support/TimeValue.cpp&p1=llvm/trunk/unittests/System/TimeValue.cpp&r1=120329&r2=120330&rev=120330&view=diff
==============================================================================
--- llvm/trunk/unittests/System/TimeValue.cpp (original)
+++ llvm/trunk/unittests/Support/TimeValue.cpp Mon Nov 29 16:29:04 2010
@@ -1,4 +1,4 @@
-//===- llvm/unittest/System/TimeValue.cpp - Time Vlaue tests --------------===//
+//===- llvm/unittest/Support/TimeValue.cpp - Time Value tests -------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -14,7 +14,7 @@
 using namespace llvm;
 namespace {
 
-TEST(System, TimeValue) {
+TEST(Support, TimeValue) {
   sys::TimeValue now = sys::TimeValue::now();
   time_t now_t = time(NULL);
   EXPECT_TRUE(abs(static_cast<long>(now_t - now.toEpochTime())) < 2);

Removed: llvm/trunk/unittests/System/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/System/Makefile?rev=120329&view=auto
==============================================================================
--- llvm/trunk/unittests/System/Makefile (original)
+++ llvm/trunk/unittests/System/Makefile (removed)
@@ -1,15 +0,0 @@
-##===- 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 := support
-
-include $(LEVEL)/Makefile.config
-include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest

Removed: llvm/trunk/unittests/System/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/System/Path.cpp?rev=120329&view=auto
==============================================================================
--- llvm/trunk/unittests/System/Path.cpp (original)
+++ llvm/trunk/unittests/System/Path.cpp (removed)
@@ -1,91 +0,0 @@
-//===- 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 "llvm/Support/PathV2.h"
-
-#include "gtest/gtest.h"
-
-using namespace llvm;
-
-namespace {
-
-TEST(System, Path) {
-  SmallVector<StringRef, 40> paths;
-  paths.push_back("");
-  paths.push_back(".");
-  paths.push_back("..");
-  paths.push_back("foo");
-  paths.push_back("/");
-  paths.push_back("/foo");
-  paths.push_back("foo/");
-  paths.push_back("/foo/");
-  paths.push_back("foo/bar");
-  paths.push_back("/foo/bar");
-  paths.push_back("//net");
-  paths.push_back("//net/foo");
-  paths.push_back("///foo///");
-  paths.push_back("///foo///bar");
-  paths.push_back("/.");
-  paths.push_back("./");
-  paths.push_back("/..");
-  paths.push_back("../");
-  paths.push_back("foo/.");
-  paths.push_back("foo/..");
-  paths.push_back("foo/./");
-  paths.push_back("foo/./bar");
-  paths.push_back("foo/..");
-  paths.push_back("foo/../");
-  paths.push_back("foo/../bar");
-  paths.push_back("c:");
-  paths.push_back("c:/");
-  paths.push_back("c:foo");
-  paths.push_back("c:/foo");
-  paths.push_back("c:foo/");
-  paths.push_back("c:/foo/");
-  paths.push_back("c:/foo/bar");
-  paths.push_back("prn:");
-  paths.push_back("c:\\");
-  paths.push_back("c:foo");
-  paths.push_back("c:\\foo");
-  paths.push_back("c:foo\\");
-  paths.push_back("c:\\foo\\");
-  paths.push_back("c:\\foo/");
-  paths.push_back("c:/foo\\bar");
-
-  for (SmallVector<StringRef, 40>::const_iterator i = paths.begin(),
-                                                  e = paths.end();
-                                                  i != e;
-                                                  ++i) {
-    outs() << *i << " =>\n    Iteration: [";
-    for (sys::path::const_iterator ci = sys::path::begin(*i),
-                                   ce = sys::path::end(*i);
-                                   ci != ce;
-                                   ++ci) {
-      outs() << *ci << ',';
-    }
-    outs() << "]\n";
-
-    StringRef res;
-    SmallString<16> temp_store;
-    if (error_code ec = sys::path::root_path(*i, res)) ASSERT_FALSE(ec.message().c_str());
-    outs() << "    root_path: " << res << '\n';
-    if (error_code ec = sys::path::root_name(*i, res)) ASSERT_FALSE(ec.message().c_str());
-    outs() << "    root_name: " << res << '\n';
-    if (error_code ec = sys::path::root_directory(*i, res)) ASSERT_FALSE(ec.message().c_str());
-    outs() << "    root_directory: " << res << '\n';
-
-    temp_store = *i;
-    if (error_code ec = sys::path::make_absolute(temp_store)) ASSERT_FALSE(ec.message().c_str());
-    outs() << "    make_absolute: " << temp_store << '\n';
-
-    outs().flush();
-  }
-}
-
-} // anonymous namespace

Removed: llvm/trunk/unittests/System/TimeValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/System/TimeValue.cpp?rev=120329&view=auto
==============================================================================
--- llvm/trunk/unittests/System/TimeValue.cpp (original)
+++ llvm/trunk/unittests/System/TimeValue.cpp (removed)
@@ -1,23 +0,0 @@
-//===- 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/Support/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);
-}
-
-}





More information about the llvm-commits mailing list