File: RunOutputTest.cmake

package info (click to toggle)
fluidsynth 2.4.4%2Bdfsg-1%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,328 kB
  • sloc: ansic: 43,529; cpp: 1,434; xml: 1,020; makefile: 71; sh: 46
file content (31 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if( NOT test_cmd )
   message( FATAL_ERROR "test_cmd not defined" )
endif( NOT test_cmd )

if( NOT test_output )
   message( FATAL_ERROR "test_output not defined" )
endif( NOT test_output )

if( NOT expected_output )
   message( FATAL_ERROR "expected_output not defined" )
endif( NOT expected_output )

separate_arguments( test_args )

execute_process(
   COMMAND ${test_cmd} ${test_args}
   RESULT_VARIABLE test_not_successful
)

if( test_not_successful )
    message( FATAL_ERROR "${test_cmd} ${test_args} returned error ${test_not_successful}!" )
endif( test_not_successful )

execute_process(
   COMMAND ${CMAKE_COMMAND} -E compare_files ${expected_output} ${test_output}
   RESULT_VARIABLE compare_not_successful
)

if( compare_not_successful )
   message( SEND_ERROR "${test_output} does not match ${expected_output}!" )
endif( compare_not_successful )