Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from hunter-packages/pr.cli.flexibility
Browse files Browse the repository at this point in the history
relax GAUZE_RESOURCE_{FILE,DIR} regex replace
  • Loading branch information
ruslo authored Nov 22, 2017
2 parents 7791735 + e5ba762 commit 9fc38a0
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HunterGate(
SHA1 "73b5a5253b75d5ed79c89242c167ca1f94386621"
)

project(gauze VERSION 0.1)
project(gauze VERSION 0.2.1)

option(GAUZE_BUILD_TESTS "Build tests" ON)

Expand Down
4 changes: 2 additions & 2 deletions cmake/gauze_add_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ function(gauze_add_test)
set(arguments)
foreach(x ${APP_ARGUMENTS})
# Use resources as is
string(REGEX REPLACE "^\\$<GAUZE_RESOURCE_FILE:\(.*\)>$" "\\1" x "${x}")
string(REGEX REPLACE "^\\$<GAUZE_RESOURCE_DIR:\(.*\)>$" "\\1" x "${x}")
string(REGEX REPLACE "\\$<GAUZE_RESOURCE_FILE:\(.*\)>$" "\\1" x "${x}")
string(REGEX REPLACE "\\$<GAUZE_RESOURCE_DIR:\(.*\)>$" "\\1" x "${x}")
list(APPEND arguments "${x}")
endforeach()
add_test(NAME "${x_NAME}" COMMAND ${APP_TARGET} ${arguments})
Expand Down
8 changes: 4 additions & 4 deletions cmake/templates/iOSTest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ foreach(arg ${app_arguments})
string(
REGEX
REPLACE
"^\\$<GAUZE_RESOURCE_FILE:\(.*\)>$"
"\\1"
"^\(.*\)\\$<GAUZE_RESOURCE_FILE:\(.*\)>$"
"\\2"
resource_file
"${arg}"
)

string(
REGEX
REPLACE
"^\\$<GAUZE_RESOURCE_DIR:\(.*\)>$"
"\\1"
"^\(.*\)\\$<GAUZE_RESOURCE_DIR:\(.*\)>$"
"\\2"
resource_dir
"${arg}"
)
Expand Down
1 change: 1 addition & 0 deletions test/gauze/directory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ gauze_add_test(
arg3
$<GAUZE_RESOURCE_DIR:${data_dir}>
${data_dir}/just_a_string.txt
--directory=$<GAUZE_RESOURCE_DIR:${data_dir}>
)
2 changes: 1 addition & 1 deletion test/gauze/directory/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int gauze_main(int argc, char** argv) {
std::cout << "argv[" << i << "] = " << argv[i] << std::endl;
}

if(argc < 6) {
if(argc < 7) {
std::cerr << "Unexpected number of arguments: " << argc << std::endl;
return EXIT_FAILURE;
}
Expand Down
1 change: 1 addition & 0 deletions test/gauze/resource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ gauze_add_test(
arg3
$<GAUZE_RESOURCE_FILE:${data_dir}/input.txt>
${data_dir}/just_a_string.txt
--input=$<GAUZE_RESOURCE_FILE:${data_dir}/input.txt>
)
2 changes: 1 addition & 1 deletion test/gauze/resource/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int gauze_main(int argc, char** argv) {
std::cout << "argv[" << i << "] = " << argv[i] << std::endl;
}

if(argc < 6) {
if(argc < 7) {
std::cerr << "Unexpected number of arguments: " << argc << std::endl;
return EXIT_FAILURE;
}
Expand Down

0 comments on commit 9fc38a0

Please sign in to comment.