diff options
Diffstat (limited to 'config/cmake/userblockTest.cmake')
-rw-r--r-- | config/cmake/userblockTest.cmake | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 8910bb2..2b6b934 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -2,44 +2,44 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -ENDIF (NOT TEST_PROGRAM) -IF (NOT TEST_GET_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -ENDIF (NOT TEST_GET_PROGRAM) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_HFILE) - MESSAGE (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -ENDIF (NOT TEST_HFILE) -IF (NOT TEST_UFILE) - MESSAGE (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -ENDIF (NOT TEST_UFILE) -IF (NOT TEST_CHECKUB) - MESSAGE (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -ENDIF (NOT TEST_CHECKUB) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_OFILE) -# MESSAGE (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#ENDIF (NOT TEST_OFILE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") +endif (NOT TEST_PROGRAM) +if (NOT TEST_GET_PROGRAM) + message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") +endif (NOT TEST_GET_PROGRAM) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_HFILE) + message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") +endif (NOT TEST_HFILE) +if (NOT TEST_UFILE) + message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") +endif (NOT TEST_UFILE) +if (NOT TEST_CHECKUB) + message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") +endif (NOT TEST_CHECKUB) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_OFILE) +# message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") +#endif (NOT TEST_OFILE) -SET (TEST_U_STRING_LEN 0) -SET (TEST_O_STRING_LEN 0) -SET (TEST_H_STRING_LEN 0) -SET (TEST_STRING_SIZE 0) +set (TEST_U_STRING_LEN 0) +set (TEST_O_STRING_LEN 0) +set (TEST_H_STRING_LEN 0) +set (TEST_STRING_SIZE 0) -IF (TEST_CHECKUB STREQUAL "YES") +if (TEST_CHECKUB STREQUAL "YES") # find the length of the user block to check #s1=`cat $ufile | wc -c | sed -e 's/ //g'` FILE (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) - STRING (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) + string (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) # Get the size of the original user block, if any. - IF (TEST_OFILE) + if (TEST_OFILE) # 'tellub' calls H5Fget_user_block to get the size # of the user block #s2=`$JAM_BIN/tellub $origfile` @@ -51,15 +51,15 @@ IF (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL "0") FILE (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - ENDIF (TEST_OFILE) + endif (TEST_OFILE) MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - IF (NOT TEST_O_STRING_LEN STREQUAL "0") + if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -73,10 +73,10 @@ IF (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") + else (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") + endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -95,12 +95,12 @@ IF (TEST_CHECKUB STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") + message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -ELSE (TEST_CHECKUB STREQUAL "YES") + if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +else (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -110,11 +110,11 @@ ELSE (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT TEST_H_STRING_LEN STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - ENDIF (NOT TEST_H_STRING_LEN STREQUAL "0") -ENDIF (TEST_CHECKUB STREQUAL "YES") + if (NOT TEST_H_STRING_LEN STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") + endif (NOT TEST_H_STRING_LEN STREQUAL "0") +endif (TEST_CHECKUB STREQUAL "YES") # everything went fine... -MESSAGE ("Passed: The output of CHECK matched expectation") +message ("Passed: The output of CHECK matched expectation") |