summaryrefslogtreecommitdiffstats
path: root/tools/h5import
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-07-09 17:25:16 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-07-09 17:25:16 (GMT)
commit1a195c1ee0e9db43eb73495d069b68624df5eae6 (patch)
treed81e6d5ac8468965ae75a393354f66a4e32e73d3 /tools/h5import
parent9e79829ab8a586914c52d252b662d8fe5824112f (diff)
downloadhdf5-1a195c1ee0e9db43eb73495d069b68624df5eae6.zip
hdf5-1a195c1ee0e9db43eb73495d069b68624df5eae6.tar.gz
hdf5-1a195c1ee0e9db43eb73495d069b68624df5eae6.tar.bz2
[svn-r22526] ifdef around the text file generation in importtest.
reordered tests so that both scripts are in similar order. Changed ADD_H5_TEST in CMake file to always delete the created h5 file. Tested: local linux
Diffstat (limited to 'tools/h5import')
-rw-r--r--tools/h5import/CMakeLists.txt76
-rw-r--r--tools/h5import/h5importtest.c32
-rwxr-xr-xtools/h5import/h5importtestutil.sh18
3 files changed, 69 insertions, 57 deletions
diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt
index a96ebc4..bbe73a8 100644
--- a/tools/h5import/CMakeLists.txt
+++ b/tools/h5import/CMakeLists.txt
@@ -92,7 +92,7 @@ IF (BUILD_TESTING)
ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES})
FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES})
- SET (dest "${PROJECT_BINARY_DIR}/${txt_file}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}")
#MESSAGE (STATUS " Copying ${txt_file}")
ADD_CUSTOM_COMMAND (
TARGET h5import
@@ -119,24 +119,22 @@ IF (BUILD_TESTING)
##############################################################################
##############################################################################
MACRO (ADD_H5_TEST testname importfile conffile testfile)
- IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (
- NAME H5IMPORT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${testfile}
- ${testfile}.new
- ${testfile}.new.err
- ${testfile}.out
- ${testfile}.out.err
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5IMPORT-${testname}-clear-objects")
- ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5IMPORT-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${testfile}
+ ${testfile}.new
+ ${testfile}.new.err
+ ${testfile}.out
+ ${testfile}.out.err
+ )
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ SET (last_test "H5IMPORT-${testname}-clear-objects")
- ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c testfiles/${conffile} -o ${testfile})
+ ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile})
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test})
ENDIF (NOT "${last_test}" STREQUAL "")
@@ -192,8 +190,6 @@ IF (BUILD_TESTING)
binin32.bin
binuin16.bin
binuin32.bin
- txtin16.txt
- txtin32.txt
${HDF5_REFERENCE_TEST_FILES}
)
SET (last_test "H5IMPORT-clear-objects")
@@ -205,52 +201,52 @@ IF (BUILD_TESTING)
SET (last_test "H5IMPORT-h5importtest")
# ----- TESTING "ASCII I32 rank 3 - Output BE " ;
- ADD_H5_TEST (ASCII_I32 txtin32.txt txtin32.conf txtin32.h5)
+ ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5)
# ----- TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended"
- ADD_H5_TEST (ASCII_I16 txtin16.txt txtin16.conf txtin16.h5)
+ ADD_H5_TEST (ASCII_I16 testfiles/txtin16.txt testfiles/txtin16.conf txtin16.h5)
# ----- TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed "
- ADD_H5_TEST (ASCII_I8 txtin8.txt txtin8.conf txtin8.h5)
-
- # ----- TESTING "ASCII UI32 - rank 3 - Output BE"
- ADD_H5_TEST (ASCII_UI32 txtuin32.txt txtuin32.conf txtuin32.h5)
+ ADD_H5_TEST (ASCII_I8 testfiles/txtin8.txt testfiles/txtin8.conf txtin8.h5)
# ----- TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed "
- ADD_H5_TEST (ASCII_UI16 txtuin16.txt txtuin16.conf txtuin16.h5)
+ ADD_H5_TEST (ASCII_UI16 testfiles/txtuin16.txt testfiles/txtuin16.conf txtuin16.h5)
+
+ # ----- TESTING "ASCII UI32 - rank 3 - Output BE"
+ ADD_H5_TEST (ASCII_UI32 testfiles/txtuin32.txt testfiles/txtuin32.conf txtuin32.h5)
# ----- TESTING "ASCII F32 - rank 3 - Output LE "
- ADD_H5_TEST (ASCII_F32 txtfp32.txt txtfp32.conf txtfp32.h5)
+ ADD_H5_TEST (ASCII_F32 testfiles/txtfp32.txt testfiles/txtfp32.conf txtfp32.h5)
# ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed "
- ADD_H5_TEST (ASCII_F64 txtfp64.txt txtfp64.conf txtfp64.h5)
+ ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5)
# ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed "
- ADD_H5_TEST (BINARY_F64 binfp64.bin binfp64.conf binfp64.h5)
-
- # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
- ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf binin16.h5)
+ ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5)
# ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed "
- ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf binin8.h5)
+ ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5)
+
+ # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
+ ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5)
# ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED "
- ADD_H5_TEST (BINARY_I32 binin32.bin binin32.conf binin32.h5)
+ ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/binin32.conf binin32.h5)
# ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED "
- ADD_H5_TEST (BINARY_UI16 binuin16.bin binuin16.conf binuin16.h5)
+ ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5)
# ----- TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED "
- ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf binuin32.h5)
+ ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5)
# ----- TESTING "STR"
- ADD_H5_TEST (STR txtstr.txt txtstr.conf txtstr.h5)
+ ADD_H5_TEST (STR testfiles/txtstr.txt testfiles/txtstr.conf txtstr.h5)
# ----- TESTING "BINARY I8 CR LF EOF"
- ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5)
+ ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5)
# ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE "
- ADD_H5_TEST (ASCII_F64_R1 textpfe64.txt textpfe.conf textpfe.h5)
+ ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5)
ENDIF (BUILD_TESTING)
diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c
index 434cba7..49f977c 100644
--- a/tools/h5import/h5importtest.c
+++ b/tools/h5import/h5importtest.c
@@ -165,21 +165,38 @@ main(void)
#ifndef UNICOS
+#ifdef REBUILDTEXTFILES
/*-------------------------------------------------------------------------
- * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
+ * TOOLTEST txtin8.txt -c $srcdir/testfiles/txtin8.conf -o txtin8.h5
*-------------------------------------------------------------------------
*/
+ sp = HDfopen("txtin8.txt", "w");
+ for (k = 0; k < npln; k++)
+ {
+ for (i = 0; i < nrow; i++)
+ {
+ for (j = 0; j < ncol; j++)
+ (void) fprintf(sp, "%10u", b8i3[k][i][j]);
+ (void) fprintf(sp, "\n");
+ }
+ }
+ (void) HDfclose(sp);
+
+ /*-------------------------------------------------------------------------
+ * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
+ *-------------------------------------------------------------------------
+ */
sp = HDfopen("txtin16.txt", "w");
for (k = 0; k < npln; k++)
{
- for (i = 0; i < nrow; i++)
- {
- for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10u", b16i3[k][i][j]);
- (void) fprintf(sp, "\n");
- }
+ for (i = 0; i < nrow; i++)
+ {
+ for (j = 0; j < ncol; j++)
+ (void) fprintf(sp, "%10u", b16i3[k][i][j]);
+ (void) fprintf(sp, "\n");
+ }
}
(void) HDfclose(sp);
@@ -199,6 +216,7 @@ main(void)
}
}
(void) HDfclose(sp);
+#endif
/*-------------------------------------------------------------------------
* TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5
diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh
index 37613dd..7289b2a 100755
--- a/tools/h5import/h5importtestutil.sh
+++ b/tools/h5import/h5importtestutil.sh
@@ -181,20 +181,20 @@ TOOLTEST $TESTDIR/txtin32.txt -c $TESTDIR/txtin32.conf -o txtin32.h5
TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended"
TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5
-
TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed "
TOOLTEST $TESTDIR/txtin8.txt -c $TESTDIR/txtin8.conf -o txtin8.h5
-TESTING "ASCII UI32 - rank 3 - Output BE"
-TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5
TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed "
TOOLTEST $TESTDIR/txtuin16.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5
+TESTING "ASCII UI32 - rank 3 - Output BE"
+TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5
+
+
TESTING "ASCII F32 - rank 3 - Output LE "
TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5
-
TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed "
TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5
@@ -202,13 +202,11 @@ TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed "
TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5
-TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
-TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5
-
-
TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed "
TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5
+TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
+TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5
TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED "
TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5
@@ -224,6 +222,7 @@ TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5
TESTING "STR"
TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5
+
TESTING "BINARY I8 CR LF EOF"
TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5
@@ -231,8 +230,7 @@ TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE "
TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5
-
-rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.h5
+rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.h5
rm -rf tmp_testfiles
else
echo "** h5import or h5importtest not available ***"