-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
050b93d
commit dcfe9b8
Showing
7 changed files
with
90 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "unit_test_for_cmake"] | ||
path = unit_test_for_cmake | ||
url = ../unit_test_for_cmake.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
project(test_add_target) | ||
|
||
include(add_target.cmake) | ||
|
||
include(FetchContent) | ||
FetchContent_Declare( | ||
cmake_test | ||
GIT_REPOSITORY https://github.com/CMakePP/CMakeTest | ||
) | ||
FetchContent_MakeAvailable(cmake_test) | ||
include(cmake_test/cmake_test) | ||
|
||
ct_add_dir("${CMAKE_CURRENT_SOURCE_DIR}/test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
ct_add_test(NAME main) | ||
function(${CMAKETEST_TEST}) | ||
parse_file_options("test.cpp" file options) | ||
ct_assert_equal(file "test.cpp") | ||
ct_assert_not_defined(options) | ||
|
||
parse_file_options("test.cpp:toto" file options) | ||
ct_assert_equal(file "test.cpp") | ||
ct_assert_equal(options, "toto") | ||
|
||
parse_file_options("test.cpp:toto,tata" file options) | ||
ct_assert_equal(file "test.cpp") | ||
ct_assert_equal(options, "toto;tata") | ||
|
||
parse_file_options("test.cpp" file options) | ||
ct_assert_equal(file "test.cpp") | ||
ct_assert_not_defined(options) | ||
|
||
parse_file_options("" file options) | ||
ct_assert_not_defined(file) | ||
ct_assert_not_defined(options) | ||
|
||
parse_file_options(":" file options) | ||
ct_assert_not_defined(file) | ||
ct_assert_not_defined(options) | ||
|
||
parse_file_options("test.cpp:" file options) | ||
ct_assert_equal(file "test.cpp") | ||
ct_assert_not_defined(options) | ||
|
||
parse_file_options(":toto" file options) | ||
ct_assert_not_defined(file) | ||
ct_assert_not_defined(options) | ||
endfunction() | ||
|
||
|
||
# Using same variable names as in function definition because some | ||
# implementations may break in this case. | ||
ct_add_test(NAME same_variable_names) | ||
function(${CMAKETEST_TEST}) | ||
parse_file_options("test.cpp" out_file out_options) | ||
ct_assert_equal(out_file "test.cpp") | ||
ct_assert_not_defined(out_options) | ||
|
||
parse_file_options("test.cpp:toto" out_file out_options) | ||
ct_assert_equal(out_file "test.cpp") | ||
ct_assert_equal(out_options "toto") | ||
|
||
parse_file_options("test.cpp" out_file out_options) | ||
ct_assert_equal(out_file "test.cpp") | ||
ct_assert_not_defined(out_options "toto") | ||
|
||
parse_file_options(":" out_file out_options) | ||
ct_assert_not_defined(out_file) | ||
ct_assert_not_defined(out_options) | ||
|
||
parse_file_options("test.cpp:" out_file out_options) | ||
ct_assert_equal(out_file "test.cpp") | ||
ct_assert_not_defined(out_options) | ||
|
||
parse_file_options(":toto" out_file out_options) | ||
ct_assert_not_defined(out_file) | ||
ct_assert_not_defined(out_options) | ||
endfunction() |
This file was deleted.
Oops, something went wrong.
Submodule unit_test_for_cmake
deleted from
59c4f8