summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-07-16 18:01:53 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-07-16 18:01:53 (GMT)
commit47780cb4e03f0b4308f28e5c8b5c5935fda73df1 (patch)
tree1730fb9888a5e3fcf8350685ad78945ede33f4c0
parent643593dfda47f0dfe2159ae494a1f80142da3f4e (diff)
downloadhdf5-47780cb4e03f0b4308f28e5c8b5c5935fda73df1.zip
hdf5-47780cb4e03f0b4308f28e5c8b5c5935fda73df1.tar.gz
hdf5-47780cb4e03f0b4308f28e5c8b5c5935fda73df1.tar.bz2
TRILAB-31 Working locally
-rw-r--r--MANIFEST3
-rwxr-xr-xbin/runbkgprog87
-rw-r--r--config/cmake/UseJava.cmake26
-rw-r--r--test/CMakeTests.cmake113
-rw-r--r--test/ShellTests.cmake244
-rw-r--r--test/flushrefreshTest.cmake172
6 files changed, 605 insertions, 40 deletions
diff --git a/MANIFEST b/MANIFEST
index 79c2ef6..02c9928 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -85,6 +85,7 @@
./bin/release
./bin/restore.sh
./bin/runtest _DO_NOT_DISTRIBUTE_
+./bin/runbkgprog _DO_NOT_DISTRIBUTE_
./bin/snapshot
./bin/snapshot_version _DO_NOT_DISTRIBUTE_
./bin/switch_maint_mode _DO_NOT_DISTRIBUTE_
@@ -3248,6 +3249,8 @@
./test/CMakeLists.txt
./test/CMakeTests.cmake
./test/CMakeVFDTests.cmake
+./test/flushrefreshTest.cmake
+./test/ShellTests.cmake
./testpar/CMakeLists.txt
./testpar/CMakeTests.cmake
./tools/CMakeLists.txt
diff --git a/bin/runbkgprog b/bin/runbkgprog
new file mode 100755
index 0000000..69fa2d0
--- /dev/null
+++ b/bin/runbkgprog
@@ -0,0 +1,87 @@
+#!/usr/bin/perl -w
+require 5.003;
+$indent=4;
+
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+# Run program in background
+#
+use warnings;
+use strict;
+
+use Carp;
+use Time::HiRes;
+use POSIX 'setsid';
+
+my $child_pid;
+my $child_proc;
+my $cmd = $ARGV[0];
+my $debug = 1;
+
+print "\nStart child process\n";
+start_child();
+print "\nStarted child process\n";
+
+sub start_child {
+ die "cannot execute cmd: $cmd" unless -x $cmd;
+ if ($^O eq 'MSWin32') { # Windows
+ require Win32::Process;
+ Win32::Process::Create($child_proc, $cmd, $cmd, 0, 0, ".") || confess "Could not spawn child: $!";
+ $child_pid = $child_proc->GetProcessID();
+ }
+ else { # Unix
+ $SIG{CHLD} = 'IGNORE';
+ $child_pid = fork();
+ unless (defined $child_pid) {
+ confess "Could not spawn child (Unix): $!";
+ }
+ if ($child_pid == 0) { # child
+ unless ($debug) {
+ open STDIN, "<", "/dev/null" or die "Can't read /dev/null: $!";
+ open STDOUT, ">", "/dev/null" or die "Can't write /dev/null: $!";
+ }
+ setsid or warn "setsid cannot start a new session: $!";
+ unless ($debug) {
+ open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+ }
+ local $| = 1;
+ unless (exec($cmd)) {
+ confess "Could not start child: $cmd: $!";
+ CORE::exit(0);
+ }
+ }
+ # parent
+ $SIG{CHLD} = 'DEFAULT';
+ }
+ # catch early child exit, e.g. if program path is incorrect
+ sleep(1.0);
+ POSIX::waitpid(-1, POSIX::WNOHANG()); # clean up any defunct child process
+ if (kill(0,$child_pid)) {
+ print "\nStarted child process id $child_pid\n";
+ }
+ else {
+ warn "Child process exited quickly: $cmd: process $child_pid";
+ }
+}
+
+sub stop_child
+{
+ if ($^O eq 'MSWin32') { # Windows
+ Win32::Process::KillProcess($child_pid,0);
+ }
+ else { # Unix
+ kill 9, $child_pid || warn "could not kill process $child_pid: $!";
+ }
+ print "Stopped child process id $child_pid\n";
+}
diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake
index 10ffe47..754d742 100644
--- a/config/cmake/UseJava.cmake
+++ b/config/cmake/UseJava.cmake
@@ -383,7 +383,7 @@
# Create C header files from java classes. These files provide the connective glue
# that allow your Java and C code to interact.
#
-# This command will no longer be supported starting with version 1.10 of the JDK due
+# This command will no longer be supported starting with version 10 of the JDK due
# to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead.
#
@@ -447,7 +447,7 @@ endfunction ()
function(__java_lcat VAR)
foreach(_line ${ARGN})
- set(${VAR} "${${VAR}}${_line}\n")
+ string(APPEND ${VAR} "${_line}\n")
endforeach()
set(${VAR} "${${VAR}}" PARENT_SCOPE)
@@ -528,7 +528,7 @@ function(add_jar _TARGET_NAME)
if (_add_jar_GENERATE_NATIVE_HEADERS)
# Raise an error if JDK version is less than 1.8 because javac -h is not supported
# by earlier versions.
- if ("${Java_VERSION}" VERSION_LESS 1.8)
+ if (Java_VERSION VERSION_LESS 1.8)
message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.")
endif()
cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS})
@@ -569,7 +569,7 @@ function(add_jar _TARGET_NAME)
endif()
foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
- set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@@ -641,7 +641,7 @@ function(add_jar _TARGET_NAME)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
- set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR})
@@ -649,7 +649,7 @@ function(add_jar _TARGET_NAME)
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif ()
else ()
- set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
+ string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")
@@ -794,11 +794,9 @@ function(add_jar _TARGET_NAME)
if (_GENERATE_NATIVE_HEADERS)
# create an INTERFACE library encapsulating include directory for generated headers
add_library (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE)
- target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET}
- INTERFACE
- "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}"
- ${JNI_INCLUDE_DIRS}
- )
+ target_include_directories (${_GENERATE_NATIVE_HEADERS_TARGET} INTERFACE
+ "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}"
+ ${JNI_INCLUDE_DIRS})
# this INTERFACE library depends on jar generation
add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME})
@@ -1375,10 +1373,10 @@ function(create_javadoc _target)
endfunction()
function (create_javah)
- if ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.10)
+ if (Java_VERSION VERSION_GREATER_EQUAL 10)
message (FATAL_ERROR "create_javah: not supported with this Java version. Use add_jar(GENERATE_NATIVE_HEADERS) instead.")
- elseif ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.8)
- message (DEPRECATION "create_javah: this command will no longer be supported starting with version 1.10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.")
+ elseif (Java_VERSION VERSION_GREATER_EQUAL 1.8)
+ message (DEPRECATION "create_javah: this command will no longer be supported starting with version 10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.")
endif()
cmake_parse_arguments(_create_javah
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 39d9d0d..34e21f7 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -228,29 +228,30 @@ add_test (NAME H5TEST-clear-testhdf5-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-testhdf5-objects PROPERTIES FIXTURES_SETUP clear_testhdf5)
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5TEST-testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select)
set_tests_properties (H5TEST-testhdf5-base PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
+ FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (NAME H5TEST-testhdf5-heap COMMAND $<TARGET_FILE:testhdf5> -o heap)
set_tests_properties (H5TEST-testhdf5-heap PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
+ FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (NAME H5TEST-testhdf5-file COMMAND $<TARGET_FILE:testhdf5> -o file)
set_tests_properties (H5TEST-testhdf5-file PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
+ FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
add_test (NAME H5TEST-testhdf5-select COMMAND $<TARGET_FILE:testhdf5> -o select)
set_tests_properties (H5TEST-testhdf5-select PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
+ FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -266,7 +267,7 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-testhdf5 PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
+ FIXTURES_REQUIRED clear_testhdf5
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -295,6 +296,7 @@ else ()
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-shared-clear-testhdf5-objects PROPERTIES FIXTURES_SETUP shared_clear_testhdf5)
add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:testhdf5-shared>"
-D "TEST_ARGS:STRING="
@@ -306,7 +308,7 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES
- DEPENDS H5TEST-shared-clear-testhdf5-objects
+ FIXTURES_REQUIRED shared_clear_testhdf5
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -543,6 +545,7 @@ add_test (NAME H5TEST-clear-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_objects)
set (H5TEST_SEPARATE_TESTS
testhdf5
@@ -554,7 +557,7 @@ foreach (test ${H5_TESTS})
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
set_tests_properties (H5TEST-${test} PROPERTIES
- DEPENDS H5TEST-clear-objects
+ FIXTURES_REQUIRED clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -576,7 +579,7 @@ foreach (test ${H5_TESTS})
)
endif ()
set_tests_properties (H5TEST-${test} PROPERTIES
- DEPENDS H5TEST-clear-objects
+ FIXTURES_REQUIRED clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -599,6 +602,7 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-shared-clear-objects PROPERTIES FIXTURES_SETUP shared_clear_objects)
foreach (test ${H5_TESTS})
if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
@@ -619,7 +623,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
set_tests_properties (H5TEST-shared-${test} PROPERTIES
- DEPENDS H5TEST-shared-clear-objects
+ FIXTURES_REQUIRED shared_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -642,6 +646,7 @@ if (NOT CYGWIN)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+ set_tests_properties (H5TEST-clear-cache-objects PROPERTIES FIXTURES_SETUP cache_clear_objects)
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5TEST-cache COMMAND $<TARGET_FILE:cache>)
else ()
@@ -657,7 +662,7 @@ if (NOT CYGWIN)
)
endif ()
set_tests_properties (H5TEST-cache PROPERTIES
- DEPENDS H5TEST-clear-cache-objects
+ FIXTURES_REQUIRED cache_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -673,9 +678,10 @@ add_test (
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-cache_image-objects PROPERTIES FIXTURES_SETUP cache_image_clear_objects)
add_test (NAME H5TEST-cache_image COMMAND $<TARGET_FILE:cache_image>)
set_tests_properties (H5TEST-cache_image PROPERTIES
- DEPENDS H5TEST-clear-cache_image-objects
+ FIXTURES_REQUIRED cache_image_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -690,6 +696,7 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP shared_cache_clear_objects)
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>)
else ()
@@ -705,7 +712,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
set_tests_properties (H5TEST-shared-cache PROPERTIES
- DEPENDS H5TEST-shared-clear-cache-objects
+ FIXTURES_REQUIRED shared_cache_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -756,9 +763,10 @@ add_test (
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-filenotclosed-objects PROPERTIES FIXTURES_SETUP filenotclosed_clear_objects)
add_test (NAME H5TEST-filenotclosed COMMAND $<TARGET_FILE:filenotclosed>)
set_tests_properties (H5TEST-filenotclosed PROPERTIES
- DEPENDS H5TEST-clear-filenotclosed-objects
+ FIXTURES_REQUIRED filenotclosed_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -773,6 +781,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+ set_tests_properties (H5TEST-clear-err_compat-objects PROPERTIES FIXTURES_SETUP err_compat_clear_objects)
add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:err_compat>"
-D "TEST_ARGS:STRING="
@@ -784,7 +793,7 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-err_compat PROPERTIES
- DEPENDS H5TEST-clear-err_compat-objects
+ FIXTURES_REQUIRED err_compat_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -799,6 +808,7 @@ add_test (NAME H5TEST-clear-error_test-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-error_test-objects PROPERTIES FIXTURES_SETUP error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
NAME H5TEST-error_test-SKIPPED
@@ -816,7 +826,7 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-error_test PROPERTIES
- DEPENDS H5TEST-clear-error_test-objects
+ FIXTURES_REQUIRED error_test_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -834,6 +844,7 @@ add_test (NAME H5TEST-clear-links_env-objects
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
+set_tests_properties (H5TEST-clear-links_env-objects PROPERTIES FIXTURES_SETUP links_env_clear_objects)
add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:links_env>"
-D "TEST_ARGS:STRING="
@@ -846,7 +857,7 @@ add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-links_env PROPERTIES
- DEPENDS H5TEST-clear-links_env-objects
+ FIXTURES_REQUIRED links_env_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
@@ -869,6 +880,7 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-shared-clear-err_compat-objects PROPERTIES FIXTURES_SETUP shared_err_compat_clear_objects)
add_test (NAME H5TEST-shared-err_compat COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:err_compat-shared>"
-D "TEST_ARGS:STRING="
@@ -880,7 +892,7 @@ if (BUILD_SHARED_LIBS)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-shared-err_compat PROPERTIES
- DEPENDS H5TEST-shared-clear-err_compat-objects
+ FIXTURES_REQUIRED shared_err_compat_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -895,6 +907,7 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-shared-clear-error_test-objects PROPERTIES FIXTURES_SETUP shared_error_test_clear_objects)
if (HDF5_USE_16_API_DEFAULT)
add_test (
NAME H5TEST-shared-error_test-SKIPPED
@@ -912,7 +925,7 @@ if (BUILD_SHARED_LIBS)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-shared-error_test PROPERTIES
- DEPENDS H5TEST-shared-clear-error_test-objects
+ FIXTURES_REQUIRED shared_error_test_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -930,6 +943,7 @@ if (BUILD_SHARED_LIBS)
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
+ set_tests_properties (H5TEST-shared-clear-links_env-objects PROPERTIES FIXTURES_SETUP shared_links_env_clear_objects)
add_test (NAME H5TEST-shared-links_env COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:links_env-shared>"
-D "TEST_ARGS:STRING="
@@ -942,7 +956,7 @@ if (BUILD_SHARED_LIBS)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5TEST-shared-links_env PROPERTIES
- DEPENDS H5TEST-shared-clear-links_env-objects
+ FIXTURES_REQUIRED shared_links_env_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
)
@@ -982,13 +996,60 @@ set_tests_properties (H5PLUGIN-filter_plugin PROPERTIES
#)
##############################################################################
-##############################################################################
-### S W M R T E S T S
-##############################################################################
-# testflushrefresh.sh: flushrefresh
-# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
-# testswmr.sh: swmr*
-# testvdsswmr.sh: vds_swmr*
+if (TEST_SHELL_SCRIPTS)
+ include (ShellTests.cmake)
+endif()
+
+if (ENABLE_EXTENDED_TESTS)
+ ##############################################################################
+ ### S W M R T E S T S
+ ##############################################################################
+ # testflushrefresh.sh: flushrefresh
+ # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+ # testswmr.sh: swmr*
+ # testvdsswmr.sh: vds_swmr*
+
+# add_test (NAME H5Test-swmr_check_compat_vfd COMMAND $<TARGET_FILE:swmr_check_compat_vfd>)
+
+#-- Adding test for flushrefresh
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
+ if (BUILD_SHARED_LIBS)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/flushrefresh_test")
+ endif ()
+ find_package (Perl)
+ if (PERL_FOUND)
+ add_test (NAME H5TEST-clear-testflushrefresh-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ flushrefresh.txt
+ flushrefresh.txt.err
+ flushrefresh.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
+ )
+ set_tests_properties (H5TEST-clear-testflushrefresh-objects PROPERTIES FIXTURES_SETUP testflushrefresh_clear_objects)
+ add_test (NAME H5TEST-testflushrefresh COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:flushrefresh>"
+ -D "TEST_ARGS1:STRING=flushrefresh_VERIFICATION_START"
+ -D "TEST_ARGS2:STRING=flushrefresh_VERIFICATION_DONE"
+ -D "TEST_ERR:STRING=flushrefresh_ERROR"
+ -D "TEST_EXPECT=0"
+ -D "TEST_OUTPUT=flushrefresh.out"
+ -D "TEST_REFERENCE=flushrefresh.txt"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test"
+ -D "PERL_SCRIPT=${HDF5_SOURCE_DIR}/bin/runbkgprog"
+ -D "PERL_EXECUTABLE=${PERL_EXECUTABLE}"
+ -P "${HDF5_TEST_SOURCE_DIR}/flushrefreshTest.cmake"
+ )
+ set_tests_properties (H5TEST-testflushrefresh PROPERTIES
+ FIXTURES_REQUIRED testflushrefresh_clear_objects
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
+ )
+ else ()
+ message (STATUS "Cannot execute TEST flushrefresh - perl not found")
+ endif ()
+endif()
##############################################################################
##############################################################################
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
new file mode 100644
index 0000000..fe997b2
--- /dev/null
+++ b/test/ShellTests.cmake
@@ -0,0 +1,244 @@
+
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G S H E L L S C R I P T S ###
+##############################################################################
+
+if (UNIX)
+
+ find_program (SH_PROGRAM sh)
+ if (SH_PROGRAM)
+
+ ##############################################################################
+ # configure scripts to test dir
+ ##############################################################################
+ find_package (Perl)
+ if (PERL_FOUND)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY)
+ endif ()
+ configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testcheck_version.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh @ONLY)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh @ONLY)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh @ONLY)
+
+ ##############################################################################
+ # copy test programs to test dir
+ ##############################################################################
+ add_custom_command (
+ TARGET swmr_check_compat_vfd
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_check_compat_vfd>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_check_compat_vfd"
+ )
+
+ add_custom_command (
+ TARGET swmr_check_compat_vfd
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh"
+ )
+
+ add_custom_command (
+ TARGET tcheck_version
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5pubconf.h" "${HDF5_TEST_BINARY_DIR}/src/H5pubconf.h"
+ )
+
+ add_custom_command (
+ TARGET tcheck_version
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_BINARY_DIR}/libhdf5.settings" "${HDF5_TEST_BINARY_DIR}/src/libhdf5.settings"
+ )
+
+ add_custom_command (
+ TARGET tcheck_version
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/src/H5public.h" "${HDF5_TEST_BINARY_DIR}/src/H5public.h"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
+ add_custom_command (
+ TARGET flushrefresh
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:flushrefresh>" "${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh"
+ )
+
+ #shell script creates dir
+ #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
+ add_custom_command (
+ TARGET use_append_mchunks
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_append_mchunks>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_mchunks"
+ )
+ add_custom_command (
+ TARGET use_disable_mdc_flushes
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_disable_mdc_flushes>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_disable_mdc_flushes"
+ )
+ add_custom_command (
+ TARGET twriteorder
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:twriteorder>" "${HDF5_TEST_BINARY_DIR}/H5TEST/twriteorder"
+ )
+ add_custom_command (
+ TARGET use_append_chunk
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_append_chunk>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_chunk"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
+ add_custom_command (
+ TARGET swmr_generator
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_generator>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_generator"
+ )
+ add_custom_command (
+ TARGET swmr_start_write
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_start_write>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_start_write"
+ )
+ add_custom_command (
+ TARGET swmr_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_reader"
+ )
+ add_custom_command (
+ TARGET swmr_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_writer"
+ )
+ add_custom_command (
+ TARGET swmr_remove_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_reader"
+ )
+ add_custom_command (
+ TARGET swmr_remove_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_writer"
+ )
+ add_custom_command (
+ TARGET swmr_addrem_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_addrem_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_addrem_writer"
+ )
+ add_custom_command (
+ TARGET swmr_sparse_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_reader"
+ )
+ add_custom_command (
+ TARGET swmr_sparse_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_writer"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")
+ add_custom_command (
+ TARGET vds_swmr_gen
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_gen>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_gen"
+ )
+ add_custom_command (
+ TARGET vds_swmr_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_writer"
+ )
+ add_custom_command (
+ TARGET vds_swmr_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_reader"
+ )
+
+
+
+ ##############################################################################
+ ##############################################################################
+ ### A D D I T I O N A L T E S T S ###
+ ##############################################################################
+ ##############################################################################
+ # H5_CHECK_TESTS
+ #---------------
+ # tcheck_version
+ # atomic_writer
+ # atomic_reader
+ # filenotclosed
+ # flushrefresh
+ ##############################################################################
+ # autotools script tests
+ # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
+ # NOT CONVERTED tcheck_version is used by testcheck_version.sh.
+ # NOT CONVERTED accum_swmr_reader is used by accum.c.
+ # NOT CONVERTED atomic_writer and atomic_reader are standalone programs.
+ # links_env is used by testlinks_env.sh
+ # filenotclosed is used by test_filenotclosed.sh
+ # NOT CONVERTED flushrefresh is used by testflushrefresh.sh.
+ # NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh
+ # NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh.
+ # NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh
+ # NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG.
+ # NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly,
+ # NOT CONVERTED and this lets automake keep all its test programs in one place.
+ ##############################################################################
+
+ ##############################################################################
+ ### S W M R T E S T S
+ ##############################################################################
+ # testflushrefresh.sh: flushrefresh
+ # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+ # testswmr.sh: swmr*
+ # testvdsswmr.sh: vds_swmr*
+ add_test (H5SHELL-testflushrefresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh)
+ set_tests_properties (H5SHELL-testflushrefresh PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-test_usecases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh)
+ set_tests_properties (H5SHELL-test_usecases PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-testswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh)
+ set_tests_properties (H5SHELL-testswmr PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-testvdsswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh)
+ set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-testcheck_version ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh)
+ set_tests_properties (H5SHELL-testcheck_version PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+
+ endif ()
+endif ()
diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake
new file mode 100644
index 0000000..f66ee64
--- /dev/null
+++ b/test/flushrefreshTest.cmake
@@ -0,0 +1,172 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# runTest.cmake executes a command and captures the output in a file. File is then compared
+# against a reference file. Exit status of command can also be compared.
+cmake_policy(SET CMP0007 NEW)
+
+# arguments checking
+if (NOT TEST_PROGRAM)
+ message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
+endif ()
+if (NOT TEST_FOLDER)
+ message ( FATAL_ERROR "Require TEST_FOLDER to be defined")
+endif ()
+if (NOT TEST_OUTPUT)
+ message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
+endif ()
+if (NOT PERL_SCRIPT)
+ message (STATUS "Require PERL_BIN_DIR to be defined")
+endif ()
+if (NOT PERL_EXECUTABLE)
+ message (STATUS "Require PERL_EXECUTABLE to be defined")
+endif ()
+
+if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
+endif ()
+
+if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+endif ()
+
+message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+
+if (TEST_LIBRARY_DIRECTORY)
+ if (WIN32 AND NOT MINGW)
+ set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
+ else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
+ endif ()
+endif ()
+
+if (TEST_ENV_VAR)
+ set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
+endif ()
+
+message(STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
+execute_process (
+ COMMAND ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}
+ RESULT_VARIABLE SCRIPT_RESULT
+ ERROR_VARIABLE SCRIPT_ERR
+ OUTPUT_VARIABLE SCRIPT_OUTPUT
+ WORKING_DIRECTORY ${TEST_FOLDER}
+)
+message(STATUS "Background: ${SCRIPT_OUTPUT}")
+if (NOT "${SCRIPT_RESULT}" STREQUAL "0")
+ message (FATAL_ERROR "Failed: The background script failed ${SCRIPT_RESULT}: ${SCRIPT_ERR}")
+endif ()
+
+set(verification_done "0")
+while(verification_done LESS "1")
+ message(STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+ # Error exit script
+ set(verification_done "3")
+ elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
+ list (LENGTH v1 len_v1)
+ message(STATUS "v1:${v1} len_v1:${len_v1}")
+ if (NOT "${len_v1}" STREQUAL "0")
+ list (GET v1 0 param1)
+ list (GET v1 -1 param2)
+ endif ()
+ file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+
+ if(${param1} MATCHES "VERIFICATION_DONE")
+ set(verification_done "1")
+ file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
+ message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else()
+ message(STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
+ execute_process (
+ COMMAND ${TEST_PROGRAM} ${param1} ${param2}
+ RESULT_VARIABLE TEST_RESULT
+ OUTPUT_FILE ${TEST_OUTPUT}
+ ERROR_FILE ${TEST_OUTPUT}.err
+ OUTPUT_VARIABLE TEST_OUT
+ ERROR_VARIABLE TEST_ERROR
+ WORKING_DIRECTORY ${TEST_FOLDER}
+ )
+ message(STATUS "flush verification: ${TEST_OUT}")
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (FATAL_ERROR "Failed: The flush verification failed ${TEST_RESULT}: ${TEST_ERROR}")
+ endif ()
+ file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
+ endif()
+ else()
+ message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ #execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
+ endif()
+endwhile()
+
+while(verification_done LESS "2")
+ message(STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+ # Error exit script
+ set(verification_done "3")
+ elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
+ list (LENGTH v1 len_v1)
+ message(STATUS "v1:${v1} len_v1:${len_v1}")
+ if (NOT "${len_v1}" STREQUAL "0")
+ list (GET v1 0 param1)
+ list (GET v1 -1 param2)
+ endif ()
+ file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+
+ if(${param1} MATCHES "VERIFICATION_DONE")
+ set(verification_done "2")
+ file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
+ message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else()
+ message(STATUS "execute: ${TEST_PROGRAM} ${param1}")
+ execute_process (
+ COMMAND ${TEST_PROGRAM} ${param1}
+ RESULT_VARIABLE TEST_RESULT
+ OUTPUT_FILE ${TEST_OUTPUT}
+ ERROR_FILE ${TEST_OUTPUT}.err
+ OUTPUT_VARIABLE TEST_OUT
+ ERROR_VARIABLE TEST_ERROR
+ WORKING_DIRECTORY ${TEST_FOLDER}
+ )
+ message(STATUS "refresh verification: ${TEST_OUT}")
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (FATAL_ERROR "Failed: The refresh verification failed ${TEST_RESULT}: ${TEST_ERROR}")
+ endif ()
+ file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
+ endif()
+ else()
+ message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ #execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
+ endif()
+endwhile()
+
+message (STATUS "COMMAND Result: ${TEST_RESULT}")
+
+# if the return value is !=${TEST_EXPECT} bail out
+if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
+ if (NOT TEST_NOERRDISPLAY)
+ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ message (STATUS "Output :\n${TEST_STREAM}")
+ endif ()
+ endif ()
+ message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
+endif ()
+
+message (STATUS "COMMAND Error: ${TEST_ERROR}")
+
+# everything went fine...
+message ("Passed")