File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ Makefile
8383* .nc1
8484* .nc2
8585* .nc5
86+ ! /src /utils /ncmpidiff /tst_file.nc
8687! /src /utils /ncvalidator /bad_ * .nc
8788! /src /utils /ncvalidator /bad_ * .nc ?
8889! /test /cdf_format /bad_ * .nc ?
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ AM_CPPFLAGS += -I$(top_builddir)/src/include
1111
1212bin_PROGRAMS = ncmpidiff cdfdiff
1313
14+ check_PROGRAMS = $(bin_PROGRAMS )
15+
1416noinst_LTLIBRARIES = libncmpidiff_core.la
1517libncmpidiff_core_la_SOURCES = ncmpidiff_core.c
1618
@@ -28,7 +30,20 @@ $(top_builddir)/src/libs/libpnetcdf.la:
2830
2931dist_man_MANS = ncmpidiff.1 cdfdiff.1
3032
31- EXTRA_DIST = ncmpidiff_core.h
33+ AM_TESTS_ENVIRONMENT = export check_PROGRAMS="$(check_PROGRAMS ) ";
34+ AM_TESTS_ENVIRONMENT += export SED="$(SED ) ";
35+ AM_TESTS_ENVIRONMENT += export srcdir="$(srcdir ) ";
36+ AM_TESTS_ENVIRONMENT += export TESTOUTDIR="$(FSTYPE_PREFIX )$(TESTOUTDIR ) ";
37+ AM_TESTS_ENVIRONMENT += export TESTSEQRUN="$(TESTSEQRUN ) ";
38+ AM_TESTS_ENVIRONMENT += export TESTMPIRUN="$(TESTMPIRUN ) ";
39+
40+ TESTS = $(check_PROGRAMS )
41+ XFAIL_TESTS = $(check_PROGRAMS )
42+ EST_EXTENSIONS = .sh
43+ LOG_COMPILER = $(srcdir ) /xfail_runs.sh
44+ SH_LOG_COMPILER =
45+
46+ EXTRA_DIST = ncmpidiff_core.h tst_file.nc
3247
3348CLEANFILES = core core.* *.gcda *.gcno *.gcov gmon.out
3449
Original file line number Diff line number Diff line change @@ -309,6 +309,12 @@ int main(int argc, char **argv)
309309
310310 if (argc - optind != 2 ) usage (argv [0 ]);
311311
312+ if (strcmp (argv [optind ], argv [optind + 1 ]) == 0 ) {
313+ printf ("Error: two input file names are identical (%s) ... exit\n" ,
314+ argv [optind ]);
315+ exit (1 );
316+ }
317+
312318 if (verbose && check_tolerance ) {
313319 printf ("Tolerance absolute difference = %e\n" , tolerance_difference );
314320 printf ("Tolerance ratio difference = %e\n" , tolerance_ratio );
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # Copyright (C) 2026, Northwestern University and Argonne National Laboratory
4+ # See COPYRIGHT notice in top-level directory.
5+ #
6+
7+ # Exit immediately if a command exits with a non-zero status.
8+ set -e
9+
10+ DRY_RUN=no
11+ VERBOSE=yes
12+
13+ if test " x$1 " = " x./ncmpidiff" ; then
14+ RUN_CMD=` echo ${TESTMPIRUN} | ${SED} -e " s/NP/4/g" `
15+ else
16+ RUN_CMD=$TESTSEQRUN
17+ fi
18+
19+ run_cmd () {
20+ local lineno=${BASH_LINENO[$((${#BASH_LINENO[@]} - 2))]}
21+ if test " x$VERBOSE " = xyes || test " x$DRY_RUN " = xyes ; then
22+ echo " Line $lineno CMD: $RUN_CMD $@ "
23+ fi
24+ if test " x$DRY_RUN " = xno ; then
25+ $RUN_CMD $@
26+ fi
27+ }
28+
29+ exe_name=` basename $1 `
30+
31+ # prevent user environment setting of PNETCDF_HINTS to interfere
32+ unset PNETCDF_HINTS
33+
34+ # ncmpidiff/ncdiff should error out when two input file names are identical.
35+ IDENT_FILE=${srcdir} /tst_file.nc
36+
37+ run_cmd $1 ${IDENT_FILE} ${IDENT_FILE}
38+
You can’t perform that action at this time.
0 commit comments