summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake')
-rw-r--r--Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake b/Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake
new file mode 100644
index 000000000..444c730bb
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XCTestAddBundle.cmake
@@ -0,0 +1,17 @@
+enable_language(Swift)
+find_package(XCTest REQUIRED)
+
+add_executable(TestedApp MACOSX_BUNDLE EXCLUDE_FROM_ALL foo.swift)
+
+xctest_add_bundle(TestingAppBundle TestedApp foo.swift)
+
+get_target_property(_lib_output_dir TestingAppBundle LIBRARY_OUTPUT_DIRECTORY)
+
+if (NOT DEFINED TEST_EXPECTED_OUTPUT_DIR)
+ message(FATAL_ERROR "Testing variable TEST_EXPECTED_OUTPUT_DIR is not set")
+endif()
+
+if (NOT _lib_output_dir STREQUAL TEST_EXPECTED_OUTPUT_DIR)
+ message(SEND_ERROR "Property LIBRARY_OUTPUT_DIRECTORY is expected to be ${TEST_EXPECTED_OUTPUT_DIR} "
+ "but was ${_lib_output_dir}")
+endif()