diff --git a/libsrc/Makefile.am b/libsrc/Makefile.am index 157ec9321..057fa2053 100644 --- a/libsrc/Makefile.am +++ b/libsrc/Makefile.am @@ -186,25 +186,12 @@ endif # BUILD_DLL endif # USE_NETCDF4 -# Test the netCDF-3 library. -TESTPROGRAMS = t_nc -if !USE_NETCDF4 -TESTPROGRAMS += t_type -endif -check_PROGRAMS = $(TESTPROGRAMS) -TESTS = $(TESTPROGRAMS) - -CLEANFILES += t_nc - # These files are cleaned on developer workstations (and then rebuilt # with m4), but they are included in the distribution so that the user # does not have to have m4. MAINTAINERCLEANFILES = attr.c ncx.c putget.c $(man_MANS) attrx.c putgetx.c EXTRA_DIST = attr.c ncx.c putget.c $(man_MANS) stub3.c netcdf_par.h -# This file is created by the test. -CLEANFILES += test.nc - # This tells make how to turn .m4 files into .c files. .m4.c: m4 $(AM_M4FLAGS) $(M4FLAGS) $< >$@ diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am index 75fd92a8e..3c8059042 100644 --- a/nc_test/Makefile.am +++ b/nc_test/Makefile.am @@ -11,10 +11,10 @@ AM_CPPFLAGS = -I$(top_srcdir) # These files are created by the tests. CLEANFILES = nc_test_classic.nc nc_test_64bit.nc nc_test_netcdf4.nc \ -tst_*.nc +tst_*.nc t_nc.nc large_files.nc quick_large_files.nc # These are the tests which are always run. -TESTPROGRAMS = tst_small nc_test tst_misc tst_norm tst_names +TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names # These are the source files for the main workhorse test program, # nc_test. If you pass nc_test, you are doing well. @@ -26,10 +26,8 @@ AM_CPPFLAGS += -I$(top_builddir)/liblib # If the user asked for large file tests, then add them. if LARGE_FILE_TESTS -TESTPROGRAMS += quick_large_files tst_big_var6 tst_big_var2 tst_big_rvar tst_big_var \ -tst_large large_files -CLEANFILES += large_files.nc quick_large_files.nc tst_big_var.nc \ -tst_big_var2.nc tst_big_rvar.nc +TESTPROGRAMS += quick_large_files tst_big_var6 tst_big_var2 \ +tst_big_rvar tst_big_var tst_large large_files endif # LARGE_FILE_TESTS # Set up the tests. @@ -48,4 +46,3 @@ MAINTAINERCLEANFILES = test_get.c test_put.c .m4.c: m4 $(AM_M4FLAGS) $(M4FLAGS) $< >$@ -test: check diff --git a/libsrc/t_nc.c b/nc_test/t_nc.c similarity index 96% rename from libsrc/t_nc.c rename to nc_test/t_nc.c index 096c44c8f..ca71898ee 100644 --- a/libsrc/t_nc.c +++ b/nc_test/t_nc.c @@ -1,20 +1,15 @@ -/* - * Copyright 1988 University Corporation for Atmospheric Research - * See netcdf/COPYRIGHT file for copying and redistribution conditions. - */ -/* $Id: t_nc.c,v 1.94 2010/05/27 21:34:13 dmh Exp $ */ - -/* - * Program to create a cdf, exercise all cdf functions. - * Creates cdf, stuff it full of numbers, closes it. Then - * reopens it, and checks for consistency. - * Leaves the file around afterwards. - * - * Based on a program to test the nasa look-alike program, - * so not the most appropropriate test. See ../nctest for a - * complete spec test. - */ +/* Copyright 1988-2010 University Corporation for Atmospheric Research + See netcdf/COPYRIGHT file for copying and redistribution + conditions. + Program to create a cdf, exercise all cdf functions. Creates cdf, + stuff it full of numbers, closes it. Then reopens it, and checks + for consistency. Leaves the file around afterwards. + + Based on a program to test the nasa look-alike program, so not the + most appropropriate test. See ../nctest for a complete spec test. + + $Id: t_nc.c,v 1.94 2010/05/27 21:34:13 dmh Exp $ */ #define REDEF /* #define SYNCDEBUG */ @@ -28,16 +23,13 @@ #include #include #include -#ifndef USE_DISPATCH -#include "rename.h" -#endif #define MAXSHORT 32767 #define MAXINT 2147483647 #define MAXBYTE 127 -#define FNAME "test.nc" +#define FNAME "t_nc.nc" #define NUM_DIMS 3 #define DONT_CARE -1 /* make these numbers big when you want to give this a real workout */ diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am index 856ab8fda..e7e44c724 100644 --- a/nc_test4/Makefile.am +++ b/nc_test4/Makefile.am @@ -14,10 +14,10 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/liblib @EXTERN_CFLAGS@ AM_CPPFLAGS += -I$(top_srcdir)/libsrc4 -I$(top_srcdir)/libsrc # Our test programs and sources... -check_PROGRAMS = cdm_sea_soundings tst_camrun +check_PROGRAMS = t_type cdm_sea_soundings tst_camrun cdm_sea_soundings_SOURCES = cdm_sea_soundings.c tests.h tst_camrun_SOURCES = tst_camrun.c tests.h -TESTS = cdm_sea_soundings tst_camrun +TESTS = t_type cdm_sea_soundings tst_camrun if LARGE_FILE_TESTS tst_large_SOURCES = tst_large.c tests.h diff --git a/libsrc/t_type.c b/nc_test4/t_type.c similarity index 75% rename from libsrc/t_type.c rename to nc_test4/t_type.c index 671ba5f3f..4bfb690d3 100644 --- a/libsrc/t_type.c +++ b/nc_test4/t_type.c @@ -7,27 +7,15 @@ $Id: t_type.c,v 2.3 2010/05/26 21:43:33 dmh Exp $ */ -/* #define SYNCDEBUG */ - #include +#include #include #include #include #include #include -#ifndef USE_DISPATCH -#include "rename.h" -#endif #include -/* This macro prints an error message with line number and name of - * test program. */ -#define ERR do { \ -fflush(stdout); /* Make sure our stdout is synced with stderr. */ \ -fprintf(stderr, "Sorry! Unexpected result, %s, line: %d\n", \ - __FILE__, __LINE__); \ -} while (0) - int main(int ac, char *av[]) { @@ -38,7 +26,7 @@ main(int ac, char *av[]) printf("\n *** Testing netCDF classic version of nc_inq_type..."); if (nc_inq_type(ncid, 0, name_in, &size_in) != NC_EBADTYPE) ERR; - if (nc_inq_type(ncid, NC_DOUBLE + 1, name_in, &size_in) != NC_EBADTYPE) ERR; + if (nc_inq_type(ncid, NC_STRING + 1, name_in, &size_in) != NC_EBADTYPE) ERR; if (nc_inq_type(ncid, NC_BYTE, name_in, &size_in)) ERR; if (strcmp(name_in, "byte") || size_in != 1) ERR; if (nc_inq_type(ncid, NC_CHAR, name_in, &size_in)) ERR; @@ -51,7 +39,6 @@ main(int ac, char *av[]) if (strcmp(name_in, "float") || size_in != 4) ERR; if (nc_inq_type(ncid, NC_DOUBLE, name_in, &size_in)) ERR; if (strcmp(name_in, "double") || size_in != 8) ERR; - printf(" OK!\n"); - - return 0; + SUMMARIZE_ERR; + FINAL_RESULTS; }