r275415 - The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t.

Pierre Gousseau via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 06:58:28 PDT 2016


Author: pgousseau
Date: Thu Jul 14 08:58:27 2016
New Revision: 275415

URL: http://llvm.org/viewvc/llvm-project?rev=275415&view=rev
Log:
The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t.
Following Tom Rybka suggestion, the test files are now copied to a temporary directory first.

Modified:
    cfe/trunk/test/PCH/include-timestamp.cpp

Modified: cfe/trunk/test/PCH/include-timestamp.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/include-timestamp.cpp?rev=275415&r1=275414&r2=275415&view=diff
==============================================================================
--- cfe/trunk/test/PCH/include-timestamp.cpp (original)
+++ cfe/trunk/test/PCH/include-timestamp.cpp Thu Jul 14 08:58:27 2016
@@ -1,23 +1,28 @@
 // Test that the timestamp is not included in the produced pch file with
 // -fno-pch-timestamp.
 
+// Copying files allow for read-only checkouts to run this test.
+// RUN: cp %S/Inputs/pragma-once2-pch.h %T
+// RUN: cp %S/Inputs/pragma-once2.h %T
+// RUN: cp %s %t1.cpp
+
 // Check timestamp is included by default.
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/Inputs/pragma-once2-pch.h
-// RUN: touch -m -a -t 201008011501 %S/Inputs/pragma-once2.h
-// RUN: not %clang_cc1 -include-pch %t %s 2>&1 | FileCheck -check-prefix=CHECK-TIMESTAMP %s
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %T/pragma-once2-pch.h
+// RUN: touch -m -a -t 201008011501 %T/pragma-once2.h
+// RUN: not %clang_cc1 -include-pch %t %t1.cpp 2>&1 | FileCheck -check-prefix=CHECK-TIMESTAMP %s
 
 // Check bitcode output as well.
 // RUN: llvm-bcanalyzer -dump %t | FileCheck -check-prefix=CHECK-BITCODE-TIMESTAMP-ON %s
 
 // Check timestamp inclusion is disabled by -fno-pch-timestamp.
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/Inputs/pragma-once2-pch.h -fno-pch-timestamp
-// RUN: touch -m -a -t 201008011502 %S/Inputs/pragma-once2.h
-// RUN: %clang_cc1 -include-pch %t %s 2>&1
+// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %T/pragma-once2-pch.h -fno-pch-timestamp
+// RUN: touch -m -a -t 201008011502 %T/pragma-once2.h
+// RUN: %clang_cc1 -include-pch %t %t1.cpp 2>&1
 
 // Check bitcode output as well.
 // RUN: llvm-bcanalyzer -dump %t | FileCheck -check-prefix=CHECK-BITCODE-TIMESTAMP-OFF %s
 
-#include "Inputs/pragma-once2.h"
+#include "pragma-once2.h"
 
 void g() { f(); }
 




More information about the cfe-commits mailing list