[CMake] using ctest with cpu emulator

Michael Jackson mike.jackson at bluequartz.net
Sat Feb 26 08:41:46 EST 2011


I do the following to run tests for all built archs on OS X:

# --------------------------------------------------------------------------
macro(MXA_ADD_TEST testname Exename)
    if (NOT APPLE)
        ADD_TEST(${testname} ${Exename})
    else()
        foreach(arch ${CMAKE_OSX_ARCHITECTURES})
            ADD_TEST( ${arch}_${testname} ${CMP_OSX_TOOLS_SOURCE_DIR}/UBTest.sh ${arch} ${Exename} )
        endforeach()
    endif()
endmacro()


Where the contents of the UBTest.sh is this:

#!/bin/bash
#echo "Running $1 architecture of $2 test"
arch -arch $1 $2

So if I build for ppc, x86_64 and i386 then I would get 3 tests created and run in ctest. Hope that helps.
___________________________________________________________
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson at bluequartz.net 
BlueQuartz Software               Dayton, Ohio   



On Feb 26, 2011, at 7:12 AM, Tim Blechmann wrote:

> hi all,
> 
> i am trying to run ctest with the qemu cpu emulator: so if i am compiling a test 
> case myTest, it is usually simply called with `./myTest'.
> is it possible to wrap this into a program, so that it calls `qemu-ARCHITECTURE 
> -cpu CPUTYPE ./myTest'?
> 
> thanks, tim
> 
> -- 
> tim at klingt.org
> http://tim.klingt.org
> 
> Silence is only frightening to people who are compulsively
> verbalizing.
>  William S. Burroughs
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list