[test-suite] r340226 - TestFile.cmake: Support WORKDIR argument in llvm_test_prepare() and llvm_test_verify()
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 20 15:34:22 PDT 2018
Author: matze
Date: Mon Aug 20 15:34:22 2018
New Revision: 340226
URL: http://llvm.org/viewvc/llvm-project?rev=340226&view=rev
Log:
TestFile.cmake: Support WORKDIR argument in llvm_test_prepare() and llvm_test_verify()
This makes usage consistent with llvm_test_run().
I will use this in an upcoming commit.
Modified:
test-suite/trunk/cmake/modules/TestFile.cmake
Modified: test-suite/trunk/cmake/modules/TestFile.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/TestFile.cmake?rev=340226&r1=340225&r2=340226&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/TestFile.cmake (original)
+++ test-suite/trunk/cmake/modules/TestFile.cmake Mon Aug 20 15:34:22 2018
@@ -30,13 +30,16 @@ endmacro()
# 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})
+ CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE;WORKDIR" "" ${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(DEFINED ARGS_WORKDIR)
+ set(JOINED_ARGUMENTS "cd ${ARGS_WORKDIR} ; ${JOINED_ARGUMENTS}")
+ endif()
if(NOT DEFINED ARGS_RUN_TYPE OR "${ARGS_RUN_TYPE}" STREQUAL "${TEST_SUITE_RUN_TYPE}")
set(TESTSCRIPT "${TESTSCRIPT}VERIFY: ${JOINED_ARGUMENTS}\n")
endif()
@@ -45,13 +48,16 @@ endmacro()
# 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})
+ CMAKE_PARSE_ARGUMENTS(ARGS "" "RUN_TYPE;WORKDIR" "" ${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(DEFINED ARGS_WORKDIR)
+ set(JOINED_ARGUMENTS "cd ${ARGS_WORKDIR} ; ${JOINED_ARGUMENTS}")
+ endif()
if(NOT DEFINED ARGS_RUN_TYPE OR "${ARGS_RUN_TYPE}" STREQUAL "${TEST_SUITE_RUN_TYPE}")
set(TESTSCRIPT "${TESTSCRIPT}PREPARE: ${JOINED_ARGUMENTS}\n")
endif()
More information about the llvm-commits
mailing list