2003-04-01 01:59:04 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
1998-11-21 11:36:51 +08:00
|
|
|
/*
|
|
|
|
* Programmer: Robb Matzke <matzke@llnl.gov>
|
|
|
|
* Friday, November 20, 1998
|
|
|
|
*
|
|
|
|
* Purpose: Test support stuff.
|
|
|
|
*/
|
|
|
|
#ifndef _H5TEST_H
|
|
|
|
#define _H5TEST_H
|
|
|
|
|
2001-04-04 02:09:16 +08:00
|
|
|
#include "hdf5.h"
|
|
|
|
#include "H5private.h"
|
1998-11-21 11:36:51 +08:00
|
|
|
|
2004-01-23 04:57:34 +08:00
|
|
|
/*
|
|
|
|
* Predefined test verbosity levels.
|
|
|
|
*
|
|
|
|
* Convention:
|
2005-08-14 04:53:35 +08:00
|
|
|
*
|
2004-01-23 04:57:34 +08:00
|
|
|
* The higher the verbosity value, the more information printed.
|
|
|
|
* So, output for higher verbosity also include output of all lower
|
|
|
|
* verbosity.
|
2005-08-14 04:53:35 +08:00
|
|
|
*
|
2004-01-23 04:57:34 +08:00
|
|
|
* Value Description
|
|
|
|
* 0 None: No informational message.
|
|
|
|
* 1 "All tests passed"
|
|
|
|
* 2 Header of overall test
|
|
|
|
* 3 Default: header and results of individual test
|
2005-08-14 04:53:35 +08:00
|
|
|
* 4
|
2004-01-23 04:57:34 +08:00
|
|
|
* 5 Low: Major category of tests.
|
|
|
|
* 6
|
|
|
|
* 7 Medium: Minor category of tests such as functions called.
|
|
|
|
* 8
|
|
|
|
* 9 High: Highest level. All information.
|
|
|
|
*/
|
|
|
|
#define VERBO_NONE 0 /* None */
|
|
|
|
#define VERBO_DEF 3 /* Default */
|
|
|
|
#define VERBO_LO 5 /* Low */
|
|
|
|
#define VERBO_MED 7 /* Medium */
|
|
|
|
#define VERBO_HI 9 /* High */
|
|
|
|
|
2004-01-23 07:05:55 +08:00
|
|
|
/*
|
|
|
|
* Verbose queries
|
|
|
|
* Only None needs an exact match. The rest are at least as much.
|
|
|
|
*/
|
2010-01-28 06:03:28 +08:00
|
|
|
|
|
|
|
/* A macro version of HDGetTestVerbosity(). */
|
|
|
|
/* Should be used internally by the libtest.a only. */
|
|
|
|
#define HDGetTestVerbosity() (TestVerbosity)
|
|
|
|
|
2011-11-04 21:40:10 +08:00
|
|
|
#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE)
|
|
|
|
#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF)
|
|
|
|
#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO)
|
|
|
|
#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED)
|
|
|
|
#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI)
|
2004-01-23 07:05:55 +08:00
|
|
|
|
2004-04-04 05:35:01 +08:00
|
|
|
/*
|
|
|
|
* Test controls definitions.
|
|
|
|
*/
|
2011-11-04 21:40:10 +08:00
|
|
|
#define SKIPTEST 1 /* Skip this test */
|
|
|
|
#define ONLYTEST 2 /* Do only this test */
|
|
|
|
#define BEGINTEST 3 /* Skip all tests before this test */
|
2004-04-04 05:35:01 +08:00
|
|
|
|
2000-01-26 12:20:36 +08:00
|
|
|
/*
|
|
|
|
* This contains the filename prefix specificied as command line option for
|
2005-08-14 04:53:35 +08:00
|
|
|
* the parallel test files.
|
2000-01-26 12:20:36 +08:00
|
|
|
*/
|
2010-11-20 01:45:55 +08:00
|
|
|
H5TEST_DLLVAR char *paraprefix;
|
2002-05-22 02:49:44 +08:00
|
|
|
#ifdef H5_HAVE_PARALLEL
|
2011-11-04 21:40:10 +08:00
|
|
|
H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
|
2002-05-22 02:49:44 +08:00
|
|
|
#endif
|
2000-01-26 12:20:36 +08:00
|
|
|
|
2003-04-14 19:21:18 +08:00
|
|
|
/*
|
|
|
|
* Print the current location on the standard output stream.
|
|
|
|
*/
|
2011-11-04 21:40:10 +08:00
|
|
|
#define AT() printf (" at %s:%d in %s()...\n", \
|
2012-02-13 23:31:35 +08:00
|
|
|
__FILE__, __LINE__, FUNC);
|
2003-04-14 19:21:18 +08:00
|
|
|
|
1998-11-21 11:36:51 +08:00
|
|
|
/*
|
|
|
|
* The name of the test is printed by saying TESTING("something") which will
|
|
|
|
* result in the string `Testing something' being flushed to standard output.
|
2001-01-26 01:03:29 +08:00
|
|
|
* If a test passes, fails, or is skipped then the PASSED(), H5_FAILED(), or
|
|
|
|
* SKIPPED() macro should be called. After H5_FAILED() or SKIPPED() the caller
|
1998-11-21 11:36:51 +08:00
|
|
|
* should print additional information to stdout indented by at least four
|
|
|
|
* spaces. If the h5_errors() is used for automatic error handling then
|
2001-01-26 01:03:29 +08:00
|
|
|
* the H5_FAILED() macro is invoked automatically when an API function fails.
|
1998-11-21 11:36:51 +08:00
|
|
|
*/
|
2011-11-04 21:40:10 +08:00
|
|
|
#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);}
|
|
|
|
#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);}
|
|
|
|
#define PASSED() {puts(" PASSED");fflush(stdout);}
|
|
|
|
#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
|
|
|
|
#define H5_WARNING() {puts("*WARNING*");fflush(stdout);}
|
|
|
|
#define SKIPPED() {puts(" -SKIP-");fflush(stdout);}
|
[svn-r22807] Description:
Add encode/decode API routines for property lists: H5Pencode/H5Pdecode.
Tested on:
FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode
FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/parallel, C++ & FORTRAN,
in production mode
Mac OS X/32 10.7.3 (amazon) in debug mode
Mac OS X/32 10.7.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.7.3 (amazon) w/parallel, in debug mode
2012-09-25 23:47:25 +08:00
|
|
|
#define PUTS_ERROR(s) {puts(s); AT(); goto error;}
|
2003-04-14 19:21:18 +08:00
|
|
|
#define TEST_ERROR {H5_FAILED(); AT(); goto error;}
|
2007-04-12 09:59:45 +08:00
|
|
|
#define STACK_ERROR {H5Eprint2(H5E_DEFAULT, stdout); goto error;}
|
|
|
|
#define FAIL_STACK_ERROR {H5_FAILED(); AT(); H5Eprint2(H5E_DEFAULT, stdout); \
|
|
|
|
goto error;}
|
2006-10-02 18:24:03 +08:00
|
|
|
#define FAIL_PUTS_ERROR(s) {H5_FAILED(); AT(); puts(s); goto error;}
|
1998-11-21 11:36:51 +08:00
|
|
|
|
2005-09-20 04:32:18 +08:00
|
|
|
/*
|
|
|
|
* Alarm definitions to wait up (terminate) a test that runs too long.
|
|
|
|
*/
|
2011-11-04 21:40:10 +08:00
|
|
|
#define H5_ALARM_SEC 1200 /* default is 20 minutes */
|
|
|
|
#define ALARM_ON TestAlarmOn()
|
|
|
|
#define ALARM_OFF HDalarm(0)
|
2005-09-20 04:32:18 +08:00
|
|
|
|
1998-11-21 11:36:51 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-01-07 01:53:13 +08:00
|
|
|
/* Generally useful testing routines */
|
2015-09-21 10:18:45 +08:00
|
|
|
H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl);
|
2003-05-13 22:28:09 +08:00
|
|
|
H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl);
|
2014-10-02 23:56:09 +08:00
|
|
|
H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size);
|
|
|
|
H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size);
|
2015-07-22 01:14:26 +08:00
|
|
|
H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size);
|
2003-05-13 22:28:09 +08:00
|
|
|
H5TEST_DLL hid_t h5_fileaccess(void);
|
|
|
|
H5TEST_DLL void h5_no_hwconv(void);
|
2006-10-02 18:24:03 +08:00
|
|
|
H5TEST_DLL const char *h5_rmprefix(const char *filename);
|
2003-05-13 22:28:09 +08:00
|
|
|
H5TEST_DLL void h5_reset(void);
|
2015-09-14 11:58:59 +08:00
|
|
|
H5TEST_DLL void h5_restore_err(void);
|
2003-05-13 22:28:09 +08:00
|
|
|
H5TEST_DLL void h5_show_hostname(void);
|
[svn-r15825] Description:
Fix various problems with a the core & sec2 VFDs.
Improve the h5_get_file_size() routine to handle files created with
VFDs that use multiple files.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-09 11:44:22 +08:00
|
|
|
H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl);
|
2004-01-07 01:53:13 +08:00
|
|
|
H5TEST_DLL int print_func(const char *format, ...);
|
2011-10-14 21:28:23 +08:00
|
|
|
H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name);
|
2011-04-16 06:05:23 +08:00
|
|
|
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
|
2004-01-07 01:53:13 +08:00
|
|
|
|
2016-02-17 12:30:49 +08:00
|
|
|
/* Functions that will replace VFD-dependent functions that violate
|
|
|
|
* the single responsibility principle. Unlike their predecessors,
|
|
|
|
* these new functions do not have hidden side effects.
|
|
|
|
*/
|
|
|
|
/* h5_fileaccess() replacement */
|
|
|
|
H5TEST_DLL hid_t h5_get_vfd_fapl(void);
|
|
|
|
|
|
|
|
/* h5_clean_files() replacements */
|
|
|
|
H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl);
|
|
|
|
H5TEST_DLL void h5_delete_all_test_files(const char *base_name[], hid_t fapl);
|
|
|
|
|
|
|
|
/* h5_reset() replacement */
|
|
|
|
H5TEST_DLL void h5_test_init(void);
|
|
|
|
|
|
|
|
/* h5_cleanup() replacement */
|
|
|
|
H5TEST_DLL void h5_test_shutdown(void);
|
|
|
|
|
2004-03-23 12:43:12 +08:00
|
|
|
/* Routines for operating on the list of tests (for the "all in one" tests) */
|
|
|
|
H5TEST_DLL void TestUsage(void);
|
|
|
|
H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void),
|
2011-11-04 21:40:10 +08:00
|
|
|
void (*Cleanup) (void), const char *TheDescr,
|
|
|
|
const void *Parameters);
|
2004-03-23 12:43:12 +08:00
|
|
|
H5TEST_DLL void TestInfo(const char *ProgName);
|
2004-08-19 14:32:47 +08:00
|
|
|
H5TEST_DLL void TestParseCmdLine(int argc, char *argv[]);
|
2004-03-23 12:43:12 +08:00
|
|
|
H5TEST_DLL void PerformTests(void);
|
|
|
|
H5TEST_DLL void TestSummary(void);
|
|
|
|
H5TEST_DLL void TestCleanup(void);
|
2016-07-19 06:36:44 +08:00
|
|
|
H5TEST_DLL void TestShutdown(void);
|
2004-08-19 14:32:47 +08:00
|
|
|
H5TEST_DLL void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[]));
|
2004-03-23 12:43:12 +08:00
|
|
|
H5TEST_DLL int GetTestVerbosity(void);
|
|
|
|
H5TEST_DLL int SetTestVerbosity(int newval);
|
2004-08-19 14:32:47 +08:00
|
|
|
H5TEST_DLL int GetTestSummary(void);
|
|
|
|
H5TEST_DLL int GetTestCleanup(void);
|
2006-01-09 13:14:54 +08:00
|
|
|
H5TEST_DLL int SetTestNoCleanup(void);
|
2006-04-07 23:34:40 +08:00
|
|
|
H5TEST_DLL int GetTestExpress(void);
|
|
|
|
H5TEST_DLL int SetTestExpress(int newval);
|
2004-03-23 12:43:12 +08:00
|
|
|
H5TEST_DLL void ParseTestVerbosity(char *argv);
|
|
|
|
H5TEST_DLL int GetTestNumErrs(void);
|
2005-03-19 22:11:40 +08:00
|
|
|
H5TEST_DLL void IncTestNumErrs(void);
|
2004-08-08 10:26:44 +08:00
|
|
|
H5TEST_DLL const void *GetTestParameters(void);
|
2015-07-18 13:40:06 +08:00
|
|
|
H5TEST_DLL int TestErrPrintf(const char *format, ...) H5_ATTR_FORMAT(printf, 1, 2);
|
2004-04-04 05:35:01 +08:00
|
|
|
H5TEST_DLL void SetTest(const char *testname, int action);
|
2010-08-17 05:04:53 +08:00
|
|
|
H5TEST_DLL void TestAlarmOn(void);
|
|
|
|
H5TEST_DLL void TestAlarmOff(void);
|
2004-04-04 05:35:01 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
#ifdef H5_HAVE_FILTER_SZIP
|
2004-11-03 03:12:06 +08:00
|
|
|
H5TEST_DLL int h5_szip_can_encode(void);
|
|
|
|
#endif /* H5_HAVE_FILTER_SZIP */
|
|
|
|
|
2002-06-13 02:24:25 +08:00
|
|
|
#ifdef H5_HAVE_PARALLEL
|
2004-01-07 01:53:13 +08:00
|
|
|
H5TEST_DLL int h5_set_info_object(void);
|
|
|
|
H5TEST_DLL void h5_dump_info_object(MPI_Info info);
|
2005-04-06 05:42:02 +08:00
|
|
|
H5TEST_DLL char* getenv_all(MPI_Comm comm, int root, const char* name);
|
2002-05-22 02:49:44 +08:00
|
|
|
#endif
|
1998-11-21 11:36:51 +08:00
|
|
|
|
2010-01-28 06:03:28 +08:00
|
|
|
/* Extern global variables */
|
|
|
|
H5TEST_DLLVAR int TestVerbosity;
|
|
|
|
|
1998-11-21 11:36:51 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|