[CMake] CTest - Prefixing the launch of each executable

Michael Jackson mike.jackson at bluequartz.net
Fri Dec 4 11:20:32 EST 2009


OK, Really the last follow up. I guess I didn't clean the build  
directory good enough last time. I now only get 2 tests based on using  
CMAKE_OSX_ARCHITECTURES=i386;x86_64.

  Sorry for the noise.
--
Mike Jackson <www.bluequartz.net>

On Dec 4, 2009, at 11:10 AM, Michael Jackson wrote:

> Just to follow up a bit on this, here is what I am doing:
>
>
> #  
> --------------------------------------------------------------------------
> macro(MXA_ADD_TEST testname Exename)
>    if (NOT APPLE)
>        ADD_TEST(${testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$ 
> {Exename})
>    else()
>        foreach(arch ${CMAKE_OSX_ARCHITECTURES})
>             #message(STATUS "Adding ${arch} test for ${testname}")
>            ADD_TEST( ${arch}_${testname} ${OSX_TOOLS_DIR}/UBTest.sh $ 
> {arch} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${Exename} )
>        endforeach()
>    endif()
> endmacro()
>
>
> ADD_EXECUTABLE ( MXA_DataModelTest ${MXADATAMODEL_TEST_SRCS} )
> TARGET_LINK_LIBRARIES ( MXA_DataModelTest  ${MXADATAMODEL_LIB_NAME} $ 
> {TEST_Boost_LIBS}  )
> MXA_ADD_TEST(MXA_DataModelTest MXA_DataModelTest)
>
> then when ctest is run I get the following:
> Start processing tests
> Test project /Users/mjackson/Workspace/MXADataModel/Build
>  3/ 16 Testing MXA_DataModelTest                Passed
>  4/ 16 Testing i386_MXA_DataModelTest           Passed
>  5/ 16 Testing x86_64_MXA_DataModelTest         Passed
>
> 100% tests passed, 0 tests failed out of 3
>
> Which is odd, because I would have thought I would get only 2 tests.
>
> --
> Mike Jackson <www.bluequartz.net>
>
> On Dec 4, 2009, at 10:18 AM, Michael Jackson wrote:
>
>> So the issue is to test OS X Universal binary with at least 3  
>> different code paths: i386, x86_64 and PPC.
>>
>> There is the "arch" command on the command line that can be used  
>> launch an executable using the indicated architecture. I am  
>> wondering how this might be used with CTest to test the different  
>> architectures present in a universal binary? Is there a CTEST_  
>> variable that I can set? Or something similar? Shell script wrapper  
>> for CTest? Use a custom Command in Cmake?
>>
>> Any help or pointers is appreciated.
>> _________________________________________________________
>> Mike Jackson                  mike.jackson at bluequartz.net
>> BlueQuartz Software                    www.bluequartz.net
>> Principal Software Engineer                  Dayton, Ohio
>>
>



More information about the CMake mailing list