BundleUtilities: Fix issues with custom target DEPENDS in test (#12034)

This commit is contained in:
Clinton Stimpson 2011-05-31 13:17:01 -06:00 committed by David Cole
parent e40b79e79f
commit fa4dc08a1a
4 changed files with 11 additions and 3 deletions

View File

@ -43,6 +43,7 @@ add_custom_target(testbundleutils1_test ALL
"-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" "-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
"-DOUTPUTDIR=${TESTBUNDLEDIR}" "-DOUTPUTDIR=${TESTBUNDLEDIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake" -P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake"
DEPENDS testbundleutils1 module
) )
add_dependencies(testbundleutils1_test testbundleutils1) add_dependencies(testbundleutils1_test testbundleutils1)
@ -66,5 +67,6 @@ add_custom_target(testbundleutils2_test ALL
"-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" "-DINPUTDIR=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
"-DOUTPUTDIR=${TESTBUNDLEDIR}" "-DOUTPUTDIR=${TESTBUNDLEDIR}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake" -P "${CMAKE_CURRENT_SOURCE_DIR}/bundleutils.cmake"
DEPENDS testbundleutils1 module
) )
add_dependencies(testbundleutils2_test testbundleutils2) add_dependencies(testbundleutils2_test testbundleutils2)

View File

@ -37,8 +37,9 @@ include(BundleUtilities)
fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}") fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}")
# make sure we can run the app # make sure we can run the app
execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result WORKING_DIRECTORY "${EXE_DIR}") message("Executing ${OUTPUT} in ${EXE_DIR}")
execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result OUTPUT_VARIABLE out ERROR_VARIABLE out WORKING_DIRECTORY "${EXE_DIR}")
if(NOT result STREQUAL "0") if(NOT result STREQUAL "0")
message(FATAL_ERROR " failed to execute test program") message(FATAL_ERROR " failed to execute test program\n${out}")
endif(NOT result STREQUAL "0") endif(NOT result STREQUAL "0")

View File

@ -1,6 +1,7 @@
#include "framework.h" #include "framework.h"
#include "shared.h" #include "shared.h"
#include "stdio.h"
#if defined(WIN32) #if defined(WIN32)
#include <windows.h> #include <windows.h>
@ -19,5 +20,10 @@ int main(int, char**)
void* lib = dlopen("module.so", RTLD_LAZY); void* lib = dlopen("module.so", RTLD_LAZY);
#endif #endif
if(!lib)
{
printf("Failed to open module\n");
}
return lib == 0 ? 1 : 0; return lib == 0 ? 1 : 0;
} }

View File

@ -205,7 +205,6 @@ IF(BUILD_TESTING)
--build-generator ${CMAKE_TEST_GENERATOR} --build-generator ${CMAKE_TEST_GENERATOR}
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
--build-project BundleUtilities --build-project BundleUtilities
--test-command testdir2/testbundleutils2
) )
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
endif(CMAKE_SYSTEM_NAME MATCHES "Windows" OR endif(CMAKE_SYSTEM_NAME MATCHES "Windows" OR