From ef84e81011c66edfcc5223af0eff2790004d5689 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Mon, 9 Nov 2009 11:14:21 -0500 Subject: Added test coverage for TRY_RUN in cross compile mode. --- Tests/CMakeLists.txt | 1 + Tests/CrossCompile/CMakeLists.txt | 12 ++++++++++++ Tests/CrossCompile/main.c | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 Tests/CrossCompile/CMakeLists.txt create mode 100644 Tests/CrossCompile/main.c diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e5b6523..4c54f5f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -134,6 +134,7 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(ExportImport ExportImport) ADD_TEST_MACRO(Unset Unset) ADD_TEST_MACRO(PolicyScope PolicyScope) + ADD_TEST_MACRO(CrossCompile CrossCompile) IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") diff --git a/Tests/CrossCompile/CMakeLists.txt b/Tests/CrossCompile/CMakeLists.txt new file mode 100644 index 0000000..9ef7a87 --- /dev/null +++ b/Tests/CrossCompile/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required (VERSION 2.6) +PROJECT(CrossCompile) + +#Simulate the cross compile condition +SET(CMAKE_SYSTEM_NAME "systemName") +SET(CMAKE_CROSSCOMPILING ON) + +ADD_EXECUTABLE(CrossCompile main.c) + +TRY_RUN(run_result compile_result + ${CrossCompile_BINARY_DIR} + ${CrossCompile_SOURCE_DIR}/main.c) diff --git a/Tests/CrossCompile/main.c b/Tests/CrossCompile/main.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/CrossCompile/main.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} -- cgit v0.12