[libcxx-commits] [libcxx] 38aebe5 - [libc++] Move a bunch of tests from .sh.cpp to .pass.cpp

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 31 11:20:10 PDT 2020


Author: Louis Dionne
Date: 2020-03-31T14:19:58-04:00
New Revision: 38aebe5c04ab4cb3695dc1bcc60b9a7b55215aff

URL: https://github.com/llvm/llvm-project/commit/38aebe5c04ab4cb3695dc1bcc60b9a7b55215aff
DIFF: https://github.com/llvm/llvm-project/commit/38aebe5c04ab4cb3695dc1bcc60b9a7b55215aff.diff

LOG: [libc++] Move a bunch of tests from .sh.cpp to .pass.cpp

Using the ADDITIONAL_COMPILE_FLAGS annotation, it is possible to move
these tests from .sh.cpp to .pass.cpp, making them suitable for running
on remote hosts more easily.

Added: 
    libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
    libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
    libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
    libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
    libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp

Modified: 
    

Removed: 
    libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp
    libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp
    libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp
    libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp
    libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
    libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp


################################################################################
diff  --git a/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp b/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
index 8f817de3cfab..87a4ea5fdbd6 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.sh.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-// RUN: %{build} -fno-exceptions
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fno-exceptions
 
 // UNSUPPORTED: c++98, c++03
 
@@ -43,7 +42,7 @@ int main(int, char**) {
   // have to be moved when it is resized.
   v.reserve(10);
   size_t old_cap = v.capacity();
-  for (int i = 0; i < v.capacity(); ++i) {
+  for (size_t i = 0; i < v.capacity(); ++i) {
     v.emplace_back(42);
   }
   assert(v.capacity() == old_cap);

diff  --git a/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp b/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
similarity index 96%
rename from libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp
rename to libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
index 1f49a4ac9207..1699d6714b22 100644
--- a/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp
+++ b/libcxx/test/libcxx/experimental/language.support/support.coroutines/dialect_support.pass.cpp
@@ -8,9 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 // REQUIRES: fcoroutines-ts
-
-// RUN: %{build} -fcoroutines-ts
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
 
 // A simple "breathing" test that checks that <experimental/coroutine>
 // can be parsed and used in all dialects, including C++03 in order to match

diff  --git a/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp b/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
similarity index 92%
rename from libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp
rename to libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
index e1384b2c36c0..7a09406407bf 100644
--- a/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp
+++ b/libcxx/test/libcxx/experimental/language.support/support.coroutines/version.pass.cpp
@@ -9,9 +9,7 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 // REQUIRES: fcoroutines-ts
-
-// RUN: %{build} -fcoroutines-ts
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fcoroutines-ts
 
 #include <experimental/coroutine>
 

diff  --git a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
similarity index 99%
rename from libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp
rename to libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
index 083ff534a9c4..d00f40fa4766 100644
--- a/libcxx/test/libcxx/input.output/filesystems/convert_file_time.sh.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/convert_file_time.pass.cpp
@@ -12,8 +12,7 @@
 
 // typedef TrivialClock file_time_type;
 
-// RUN: %{build} -I%{libcxx_src_root}/src/filesystem
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -I%{libcxx_src_root}/src/filesystem
 
 #include <filesystem>
 #include <chrono>

diff  --git a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
similarity index 98%
rename from libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
rename to libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
index 77e26bf8d69a..e79d2e699af6 100644
--- a/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
+++ b/libcxx/test/libcxx/language.support/support.dynamic/new_faligned_allocation.pass.cpp
@@ -13,8 +13,6 @@
 // definitions, which does not yet provide aligned allocation
 // XFAIL: LIBCXX-WINDOWS-FIXME
 
-// REQUIRES: -faligned-allocation
-
 // The dylibs shipped before macosx10.13 do not contain the aligned allocation
 // functions, so trying to force using those with -faligned-allocation results
 // in a link error.
@@ -25,8 +23,8 @@
 // XFAIL: with_system_cxx_lib=macosx10.8
 // XFAIL: with_system_cxx_lib=macosx10.7
 
-// RUN: %{build} -faligned-allocation
-// RUN: %{run}
+// REQUIRES: -faligned-allocation
+// ADDITIONAL_COMPILE_FLAGS: -faligned-allocation
 
 #include <new>
 #include <typeinfo>

diff  --git a/libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp b/libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp
similarity index 91%
rename from libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp
rename to libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp
index ffd9842c8d3a..8cebf75e458e 100644
--- a/libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.sh.cpp
+++ b/libcxx/test/libcxx/numerics/c.math/fdelayed-template-parsing.pass.cpp
@@ -9,9 +9,7 @@
 // test that cmath builds with -fdelayed-template-parsing
 
 // REQUIRES: fdelayed-template-parsing
-
-// RUN: %{build} -fdelayed-template-parsing
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fdelayed-template-parsing
 
 #include <cmath>
 #include <cassert>

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
similarity index 97%
rename from libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
rename to libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
index d604e8cb7e36..c6e55469f19a 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.pass.cpp
@@ -21,9 +21,7 @@
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: -fsized-deallocation
-
-// RUN: %{build} -fsized-deallocation
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation
 
 #if !defined(__cpp_sized_deallocation)
 # error __cpp_sized_deallocation should be defined

diff  --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
similarity index 97%
rename from libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
rename to libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
index 46d769b62c1a..06e2c38fcadb 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.pass.cpp
@@ -20,9 +20,7 @@
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: -fsized-deallocation
-
-// RUN: %{build} -fsized-deallocation -O3
-// RUN: %{run}
+// ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation, -O3
 
 #if !defined(__cpp_sized_deallocation)
 # error __cpp_sized_deallocation should be defined


        


More information about the libcxx-commits mailing list