Skip to content

Commit

Permalink
Add test for 'hunter_create_args_file'
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed May 17, 2019
1 parent 0a72dd1 commit 896e8ec
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/hunter_create_args_file/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ set(test_7_etalon "${CMAKE_CURRENT_LIST_DIR}/test_7")
set(test_8_etalon "${CMAKE_CURRENT_LIST_DIR}/test_8")
set(test_9_etalon "${CMAKE_CURRENT_LIST_DIR}/test_9")
set(test_10_etalon "${CMAKE_CURRENT_LIST_DIR}/test_10")
set(test_11_etalon "${CMAKE_CURRENT_LIST_DIR}/test_11")
set(test_12_etalon "${CMAKE_CURRENT_LIST_DIR}/test_12")
set(test_13_etalon "${CMAKE_CURRENT_LIST_DIR}/test_13")
set(test_14_etalon "${CMAKE_CURRENT_LIST_DIR}/test_14")

set(test_1 "${CMAKE_CURRENT_BINARY_DIR}/test_1")
set(test_2 "${CMAKE_CURRENT_BINARY_DIR}/test_2")
Expand All @@ -39,6 +43,10 @@ set(test_7 "${CMAKE_CURRENT_BINARY_DIR}/test_7")
set(test_8 "${CMAKE_CURRENT_BINARY_DIR}/test_8")
set(test_9 "${CMAKE_CURRENT_BINARY_DIR}/test_9")
set(test_10 "${CMAKE_CURRENT_BINARY_DIR}/test_10")
set(test_11 "${CMAKE_CURRENT_BINARY_DIR}/test_11")
set(test_12 "${CMAKE_CURRENT_BINARY_DIR}/test_12")
set(test_13 "${CMAKE_CURRENT_BINARY_DIR}/test_13")
set(test_14 "${CMAKE_CURRENT_BINARY_DIR}/test_14")

hunter_create_args_file("A=value1" "${test_1}")
hunter_create_args_file("A=value1 value2" "${test_2}")
Expand All @@ -57,6 +65,26 @@ hunter_create_args_file(
"${test_10}"
)

hunter_create_args_file(
"A=--foo=1"
"${test_11}"
)

hunter_create_args_file(
"A=--boo=1;2;3"
"${test_12}"
)

hunter_create_args_file(
"A=--boo=1;2;3;--foo=3;4;5"
"${test_13}"
)

hunter_create_args_file(
"A=1;B=--a;--b;--c=1,2,3,4;C=777"
"${test_14}"
)

check_files("${test_1_etalon}" "${test_1}")
check_files("${test_2_etalon}" "${test_2}")
check_files("${test_3_etalon}" "${test_3}")
Expand All @@ -67,3 +95,7 @@ check_files("${test_7_etalon}" "${test_7}")
check_files("${test_8_etalon}" "${test_8}")
check_files("${test_9_etalon}" "${test_9}")
check_files("${test_10_etalon}" "${test_10}")
check_files("${test_11_etalon}" "${test_11}")
check_files("${test_12_etalon}" "${test_12}")
check_files("${test_13_etalon}" "${test_13}")
check_files("${test_14_etalon}" "${test_14}")
1 change: 1 addition & 0 deletions tests/hunter_create_args_file/test_11
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set("A" "--foo=1" CACHE INTERNAL "")
3 changes: 3 additions & 0 deletions tests/hunter_create_args_file/test_12
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set("A" "--boo=1" CACHE INTERNAL "")
set("A" "${A}" "2" CACHE INTERNAL "")
set("A" "${A}" "3" CACHE INTERNAL "")
6 changes: 6 additions & 0 deletions tests/hunter_create_args_file/test_13
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set("A" "--boo=1" CACHE INTERNAL "")
set("A" "${A}" "2" CACHE INTERNAL "")
set("A" "${A}" "3" CACHE INTERNAL "")
set("A" "${A}" "--foo=3" CACHE INTERNAL "")
set("A" "${A}" "4" CACHE INTERNAL "")
set("A" "${A}" "5" CACHE INTERNAL "")
5 changes: 5 additions & 0 deletions tests/hunter_create_args_file/test_14
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set("A" "1" CACHE INTERNAL "")
set("B" "--a" CACHE INTERNAL "")
set("B" "${B}" "--b" CACHE INTERNAL "")
set("B" "${B}" "--c=1,2,3,4" CACHE INTERNAL "")
set("C" "777" CACHE INTERNAL "")

0 comments on commit 896e8ec

Please sign in to comment.