Computer Assisted Medical Intervention Tool Kit  version 5.2
CamiTKTestPassFile.h File Reference

Go to the source code of this file.

Functions

test result execute_process (COMMAND ${CMAKE_COMMAND} -E remove -f ${CAMITK_TEST_COMMAND_FILE} ${CAMITK_TEST_COMMAND_RESULT_FILE} ${CAMITK_TEST_COMMAND_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_COMMAND_FILE} ${CAMITK_TEST_PASS_FILE_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_RESULT_FILE}) file(WRITE $
 
 set (CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) set(CAMITK_TEST_COMMAND_RESULT_FILE $
 This CMake file run a command, put the command output in a given file and check if the command output is the same as the given input file. More...
 
command result set (CAMITK_TEST_COMMAND_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/command-output) set(CAMITK_TEST_PASS_FILE_COMMAND_FILE $
 
test set (CAMITK_TEST_PASS_FILE_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/test-output) set(CAMITK_TEST_PASS_FILE_RESULT_FILE $
 

Function Documentation

◆ execute_process()

test result execute_process ( COMMAND ${CMAKE_COMMAND} -E remove -f ${CAMITK_TEST_COMMAND_FILE} ${CAMITK_TEST_COMMAND_RESULT_FILE} ${CAMITK_TEST_COMMAND_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_COMMAND_FILE} ${CAMITK_TEST_PASS_FILE_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_RESULT_FILE}  )

Referenced by camitk_add_test(), camitk_cep_packaging(), and camitk_communityedition_packaging().

+ Here is the caller graph for this function:

◆ set() [1/3]

set ( CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/  command)

This CMake file run a command, put the command output in a given file and check if the command output is the same as the given input file.

Use this CMake file to test if a command returns the same log as a given expected log.

Note
You have to call camitk_test_init(..) first to prepare all variables

Inspired from http://stackoverflow.com/questions/3305545/how-to-adapt-my-unit-tests-to-cmake-and-ctest and http://www.cmake.org/pipermail/cmake/2009-July/030619.html

◆ set() [2/3]

command result set ( CAMITK_TEST_COMMAND_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/command-  output)

◆ set() [3/3]

test set ( CAMITK_TEST_PASS_FILE_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/test-  output)