Skip to content

Commit

Permalink
Merge pull request #717 from Unidata/par-cmake-update.wif
Browse files Browse the repository at this point in the history
Updating with additional parallel test fenceposts
  • Loading branch information
WardF committed Dec 8, 2017
2 parents e07a966 + 2e45037 commit 9f2a1c9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ before_install:

script:

- docker run --rm -it -h "$CURHOST" -e USEDASH=FALSE -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -e DISTCHECK=$DISTCHECK -e COPTS="$COPTS" -e AC_OPTS="$AC_OPTS" -e CTEST_OUTPUT_ON_FAILURE=1 -v $(pwd):/netcdf-c -e TESTPROC=8 $DOCKIMG
- docker run --rm -it -h "$CURHOST" -e USEDASH=FALSE -e RUNF=OFF -e RUNCXX=OFF -e RUNP=OFF -e RUNNCO=OFF -e USECMAKE=$USECMAKE -e USEAC=$USEAC -e DISTCHECK=$DISTCHECK -e COPTS="$COPTS" -e AC_OPTS="$AC_OPTS" -e CTEST_OUTPUT_ON_FAILURE=1 -v $(pwd):/netcdf-c -e TESTPROC=100 $DOCKIMG
5 changes: 5 additions & 0 deletions nc_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
LDADD = ${top_builddir}/liblib/libnetcdf.la
AM_CPPFLAGS += -I$(top_builddir)/liblib -I$(top_builddir)/include -I$(top_srcdir)/libsrc


# Note which tests depend on other tests. necessary for make -j check
TEST_EXTENSIONS = .sh

# These are the tests which are always run.
TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names \
tst_nofill tst_nofill2 tst_nofill3 tst_atts3 tst_meta tst_inq_type \
Expand Down Expand Up @@ -68,6 +72,7 @@ if BUILD_DISKLESS
TESTS += run_diskless.sh run_diskless5.sh
if BUILD_MMAP
TESTS += run_mmap.sh
run_mmap.log: run_diskless.log
endif
if LARGE_FILE_TESTS
TESTS += run_diskless2.sh
Expand Down
2 changes: 1 addition & 1 deletion nc_test/run_diskless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ diff tst_diskless3_file.cdl tst_diskless3_memory.cdl
# cleanup
rm -f $FILE3 tst_diskless3_file.cdl tst_diskless3_memory.cdl

exit
exit 0
1 change: 1 addition & 0 deletions nc_test4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ IF(USE_HDF4_FILE_TESTS AND NOT MSVC)
add_sh_test(nc_test4 run_chunk_hdf4)
add_bin_test(nc_test4 tst_h4_lendian)
add_sh_test(nc_test4 tst_hdf4_read_var)
SET_TESTS_PROPERTIES(nc_test4_tst_hdf4_read_var PROPERTIES DEPENDS tst_interops2)
ENDIF()

IF(TEST_PARALLEL4)
Expand Down
10 changes: 8 additions & 2 deletions nc_test4/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# See COPYRIGHT file for conditions of use.
#
# This entire directory will be skipped if netCDF-4 is not enabled.
# Ed Hartnett
# Ed Hartnett, Ward Fisher

# Put together AM_CPPFLAGS and AM_LDFLAGS.
include $(top_srcdir)/lib_flags.am

# Note which tests depend on other tests. necessary for make -j check
TEST_EXTENSIONS = .sh

# Link to our assembled library.
AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la

Expand Down Expand Up @@ -93,13 +96,16 @@ check_PROGRAMS += tst_interops2 tst_chunk_hdf4 tst_h4_lendian

if BUILD_UTILITIES
# This test script depends on ncdump.
TESTS += tst_formatx_hdf4.sh
TESTS += tst_formatx_hdf4.sh
endif # BUILD_UTILITIES

TESTS += run_chunk_hdf4.sh tst_h4_lendian
if USE_HDF4_FILE_TESTS
check_PROGRAMS += tst_interops3
TESTS += run_get_hdf4_files.sh tst_hdf4_read_var.sh

tst_hdf4_read_var.log: tst_interops2.log

This comment has been minimized.

Copy link
@edhartnett

edhartnett Dec 8, 2017

Contributor

I believe this will not work. Does it work for you?

My experience was that the log trick only worked for tests with an extension. That is, a straight-up C test like tst_interops2.c does not have an extension as a test (it is just tst_interops2). As a result, the TEST_EXTENSIONS trick does not work.

What I did instead was call the C programs from within the scripts, at appropriate places, and only call the scripts from the Makefile.am as TESTS. This eliminated many dependencies as well.

Instead I think you want to make tst_hdf4_read_var.log dependent on tst_formatx_hdf4.log, or else just move the tests from tst_hdf4_read_var.sh into tst_formatx_hdf4.sh (since they operate on the same file). Then there will be no dependencies. I think this is the cleanest solution and I adopted it in some other cases where the same file output was used by two scripts.


endif # USE_HDF4_FILE_TESTS
endif # USE_HDF4

Expand Down
2 changes: 2 additions & 0 deletions ncdump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ ENDIF()
ENDIF(USE_STRICT_NULL_BYTE_HEADER_PADDING)

add_sh_test(ncdump tst_nccopy3)
SET_TESTS_PROPERTIES(ncdump_tst_nccopy3 PROPERTIES RUN_SERIAL TRUE)

add_sh_test(ncdump tst_nccopy3_subset)
add_sh_test(ncdump tst_charfill)

Expand Down

1 comment on commit 9f2a1c9

@WardF
Copy link
Member Author

@WardF WardF commented on 9f2a1c9 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always hard to say whether a fix has worked for a race condition, but we have gone from reliable failures to no observed failures; should it become an issue again moving forward I’ll tweak it otherwise for now I’ll work on getting your pull request merged before I leave for AGU :)

Please sign in to comment.