summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexOneConfig
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-12-27 04:19:14 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2015-01-09 03:56:51 (GMT)
commit9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a (patch)
treed6cfe01924dd4c3ca3f57acd5d3fa59b60cde4fa /Tests/ComplexOneConfig
parent7ecbade8877522d9d565bcb2216f71426873f564 (diff)
downloadCMake-9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a.zip
CMake-9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a.tar.gz
CMake-9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a.tar.bz2
Encoding: Modify tests to work using non-ascii paths.
For complex*, CustomCommand and OutDir tests, non-ascii paths are avoided in test code by using relative paths, and setting the working when running the test. This also avoids the need to internationalize the test code. For RunCMake.GeneratorExpression, use a UTF-8 encoding in file(STRINGS) to retrieve the compiled absolute path correctly.
Diffstat (limited to 'Tests/ComplexOneConfig')
-rw-r--r--Tests/ComplexOneConfig/Executable/CMakeLists.txt14
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx22
2 files changed, 20 insertions, 16 deletions
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index 01f1005..e910f20 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -89,18 +89,22 @@ remove_definitions(-DCOMPLEX_DEFINED)
# Test pre-build/pre-link/post-build rules for an executable.
add_custom_command(TARGET complex PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
- ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt")
+ ARGS "Executable/prebuild.txt"
+ WORKING_DIRECTORY "${Complex_BINARY_DIR}")
add_custom_command(TARGET complex PRE_BUILD
COMMAND ${CREATE_FILE_EXE}
- ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt")
+ ARGS "Executable/prelink.txt"
+ WORKING_DIRECTORY "${Complex_BINARY_DIR}")
add_custom_command(TARGET complex POST_BUILD
COMMAND ${CREATE_FILE_EXE}
- ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt")
+ ARGS "Executable/postbuild.txt"
+ WORKING_DIRECTORY "${Complex_BINARY_DIR}")
add_custom_command(TARGET complex POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy
- "${Complex_BINARY_DIR}/Executable/postbuild.txt"
- "${Complex_BINARY_DIR}/Executable/postbuild2.txt")
+ "Executable/postbuild.txt"
+ "Executable/postbuild2.txt"
+ WORKING_DIRECTORY "${Complex_BINARY_DIR}")
set_source_files_properties(complex
COMPILE_FLAGS
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 31442ba..ec222a5 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -716,14 +716,14 @@ int main()
// the file was removed the last time 'complex' was run, and it is
// only created during a build.
- TestAndRemoveFile(BINARY_DIR "/Library/prebuild.txt");
- TestAndRemoveFile(BINARY_DIR "/Library/prelink.txt");
- TestAndRemoveFile(BINARY_DIR "/Library/postbuild.txt");
- TestAndRemoveFile(BINARY_DIR "/Library/postbuild2.txt");
- TestAndRemoveFile(BINARY_DIR "/Executable/prebuild.txt");
- TestAndRemoveFile(BINARY_DIR "/Executable/prelink.txt");
- TestAndRemoveFile(BINARY_DIR "/Executable/postbuild.txt");
- TestAndRemoveFile(BINARY_DIR "/Executable/postbuild2.txt");
+ TestAndRemoveFile("Library/prebuild.txt");
+ TestAndRemoveFile("Library/prelink.txt");
+ TestAndRemoveFile("Library/postbuild.txt");
+ TestAndRemoveFile("Library/postbuild2.txt");
+ TestAndRemoveFile("Executable/prebuild.txt");
+ TestAndRemoveFile("Executable/prelink.txt");
+ TestAndRemoveFile("Executable/postbuild.txt");
+ TestAndRemoveFile("Executable/postbuild2.txt");
// ----------------------------------------------------------------------
// A custom target has been created (see Library/).
@@ -733,12 +733,12 @@ int main()
// the file was removed the last time 'complex' was run, and it is
// only created during a build.
- TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt");
+ TestAndRemoveFile("Library/custom_target1.txt");
// ----------------------------------------------------------------------
// A directory has been created.
- TestDir(BINARY_DIR "/make_dir");
+ TestDir("make_dir");
// ----------------------------------------------------------------------
// Test OUTPUT_REQUIRED_FILES
@@ -749,7 +749,7 @@ int main()
// the file was removed the last time 'complex' was run, and it is
// only created during a build.
- TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt");
+ TestAndRemoveFile("Executable/Temp/complex-required.txt");
// ----------------------------------------------------------------------
// Test FIND_LIBRARY