[test-suite] r269247 - cmake: Add support for PREPARE: steps and use it where apropriate.
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed May 11 15:22:34 PDT 2016
Author: matze
Date: Wed May 11 17:22:34 2016
New Revision: 269247
URL: http://llvm.org/viewvc/llvm-project?rev=269247&view=rev
Log:
cmake: Add support for PREPARE: steps and use it where apropriate.
Modified:
test-suite/trunk/External/SPEC/CINT2000/175.vpr/CMakeLists.txt
test-suite/trunk/External/SPEC/CINT2006/456.hmmer/CMakeLists.txt
test-suite/trunk/cmake/modules/TestFile.cmake
Modified: test-suite/trunk/External/SPEC/CINT2000/175.vpr/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2000/175.vpr/CMakeLists.txt?rev=269247&r1=269246&r2=269247&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT2000/175.vpr/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT2000/175.vpr/CMakeLists.txt Wed May 11 17:22:34 2016
@@ -5,7 +5,7 @@ macro(test_input run_type costs_toleranc
set(COSTS_OUT ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input/costs.out)
# The benchmark keeps appending to costs.out, so we have to make sure there
# is none from previous runs
- llvm_test_run(RUN_TYPE ${run_type} EXECUTABLE rm -f ${COSTS_OUT})
+ llvm_test_prepare(RUN_TYPE ${run_type} rm -f ${COSTS_OUT})
llvm_test_run(RUN_TYPE ${run_type}
WORKDIR ${CMAKE_CURRENT_BINARY_DIR}/data/${run_type}/input
net.in arch.in place.out dum.out
Modified: test-suite/trunk/External/SPEC/CINT2006/456.hmmer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2006/456.hmmer/CMakeLists.txt?rev=269247&r1=269246&r2=269247&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT2006/456.hmmer/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT2006/456.hmmer/CMakeLists.txt Wed May 11 17:22:34 2016
@@ -2,8 +2,8 @@ list(APPEND LDFLAGS -lm)
macro(test_input run_type input output)
# The benchmark modifies the data file, need to copy a fresh one
- llvm_test_run(RUN_TYPE ${run_type}
- EXECUTABLE cp -f
+ llvm_test_prepare(RUN_TYPE ${run_type}
+ cp -f
${BENCHMARK_DIR}/data/${run_type}/input/${input}
${CMAKE_CURRENT_BINARY_DIR}/${input}
)
@@ -26,7 +26,8 @@ test_input(train leng100.hmm leng100.out
--fixed 0 --mean 425 --num 85000 --sd 300 --seed 0
)
# Copy nph3.hmm as well
-llvm_test_run(RUN_TYPE ref EXECUTABLE cp -f
+llvm_test_prepare(RUN_TYPE ref
+ cp -f
${BENCHMARK_DIR}/data/ref/input/nph3.hmm
${CMAKE_CURRENT_BINARY_DIR}/nph3.hmm
)
Modified: test-suite/trunk/cmake/modules/TestFile.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/TestFile.cmake?rev=269247&r1=269246&r2=269247&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/TestFile.cmake (original)
+++ test-suite/trunk/cmake/modules/TestFile.cmake Wed May 11 17:22:34 2016
@@ -1,5 +1,4 @@
-# Specify a "RUN: " line to be put in a .test file.
-# The .test file is written in the next llvm_add_test() call.
+# Specify a "RUN: " line to be put in a .test file. See also llvm_add_test().
macro(llvm_test_run)
CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE;EXECUTABLE;WORKDIR" "" ${ARGN})
# If no executable is specified use $EXECUTABLE$ placeholder which will be
@@ -21,8 +20,7 @@ macro(llvm_test_run)
endif()
endmacro()
-# Specify a "VERIFY: " line to be put in a .test file.
-# The .test file is written in the next llvm_add_test() call.
+# Specify a "VERIFY: " line to be put in a .test file. See also llvm_add_test().
macro(llvm_test_verify)
CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE" "" ${ARGN})
if(NOT DEFINED TESTSCRIPT)
@@ -36,8 +34,22 @@ macro(llvm_test_verify)
endif()
endmacro()
-# Specify a "METRIC: " line to be put in a .test file.
-# The .test file is written in the next llvm_add_test() call.
+# Specify a "PREPARE: " line to be put in a .test file. See also
+# llvm_add_test().
+macro(llvm_test_prepare)
+ CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE" "" ${ARGN})
+ if(NOT DEFINED TESTSCRIPT)
+ set(TESTSCRIPT "" PARENT_SCOPE)
+ endif()
+ # ARGS_UNPARSED_ARGUMENTS is a semicolon-separated list. Change it into a
+ # whitespace-separated string.
+ string(REPLACE ";" " " JOINED_ARGUMENTS "${ARGS_UNPARSED_ARGUMENTS}")
+ if(NOT DEFINED ARGS_RUN_TYPE OR "${ARGS_RUN_TYPE}" STREQUAL "${TEST_SUITE_RUN_TYPE}")
+ set(TESTSCRIPT "${TESTSCRIPT}PREPARE: ${JOINED_ARGUMENTS}\n")
+ endif()
+endmacro()
+
+# Specify a "METRIC: " line to be put in a .test file. See also llvm_add_test().
macro(llvm_test_metric)
CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE;METRIC" "" ${ARGN})
if(NOT DEFINED TESTSCRIPT)
More information about the llvm-commits
mailing list