2003-01-07 12:22:12 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2005-10-01 23:29:18 +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. *
|
2005-10-01 23:29:18 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
2003-01-07 12:22:12 +08:00
|
|
|
|
|
|
|
/*****************************************************************************
|
2001-03-02 02:07:25 +08:00
|
|
|
FILE
|
2001-03-06 07:09:59 +08:00
|
|
|
testhdf5.cpp - HDF5 testing framework main file.
|
2001-03-02 02:07:25 +08:00
|
|
|
|
|
|
|
REMARKS
|
2005-03-20 12:01:25 +08:00
|
|
|
General test wrapper for HDF5 C++ library test programs
|
2001-03-02 02:07:25 +08:00
|
|
|
|
|
|
|
DESIGN
|
|
|
|
Each test function should be implemented as function having no
|
|
|
|
parameters and returning void (i.e. no return value). They should be put
|
2005-03-20 12:01:25 +08:00
|
|
|
into the list of AddTest() calls in main() below. Functions which depend
|
|
|
|
on other functionality should be placed below the AddTest() call for the
|
2001-03-02 02:07:25 +08:00
|
|
|
base functionality testing.
|
|
|
|
|
2005-03-20 12:01:25 +08:00
|
|
|
EXTERNAL ROUTINES/VARIABLES:
|
|
|
|
TestInit(...) -- Initialize testing framework
|
|
|
|
TestInfo(...) -- Print test info
|
|
|
|
AddTest(...) -- Setup a test function and add it to the list of tests
|
|
|
|
TestParseCmdLine(...) -- Parse command line arguments
|
|
|
|
PerformTests() -- Perform requested testing
|
|
|
|
GetTestSummary() -- Retrieve Summary request value
|
|
|
|
TestSummary() -- Display test summary
|
|
|
|
GetTestCleanup() -- Retrieve Cleanup request value
|
|
|
|
TestCleanup() -- Clean up files from testing
|
|
|
|
GetTestNumErrs() -- Retrieve the number of testing errors
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2003-01-07 12:22:12 +08:00
|
|
|
***************************************************************************/
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2006-10-22 16:24:24 +08:00
|
|
|
#ifdef OLD_HEADER_FILENAME
|
|
|
|
#include <iostream.h>
|
|
|
|
#else
|
|
|
|
#include <iostream>
|
|
|
|
#endif
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#ifndef H5_NO_NAMESPACE
|
|
|
|
#ifndef H5_NO_STD
|
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
|
|
|
#endif // H5_NO_STD
|
|
|
|
#endif
|
|
|
|
|
2010-02-27 00:55:49 +08:00
|
|
|
#include "h5test.h" // C test header file
|
2006-10-22 16:24:24 +08:00
|
|
|
#include "H5Cpp.h" // C++ API header file
|
2001-03-02 02:07:25 +08:00
|
|
|
|
|
|
|
#ifndef H5_NO_NAMESPACE
|
2007-01-26 13:40:17 +08:00
|
|
|
using namespace H5;
|
2001-03-06 07:09:59 +08:00
|
|
|
#endif /* !H5_NO_NAMESPACE */
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2007-01-26 13:40:17 +08:00
|
|
|
#include "h5cpputil.h" // C++ utilility header file
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
int
|
2001-03-02 02:07:25 +08:00
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Initialize testing framework */
|
2004-08-19 14:32:47 +08:00
|
|
|
TestInit(argv[0], NULL, NULL);
|
2001-03-02 02:07:25 +08:00
|
|
|
|
|
|
|
// testing file creation and opening in tfile.cpp
|
2010-02-27 00:55:49 +08:00
|
|
|
AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL);
|
|
|
|
// testing dataset functionalities in dset.cpp
|
|
|
|
AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL);
|
2003-06-10 12:03:58 +08:00
|
|
|
// testing dataspace functionalities in th5s.cpp
|
2010-02-27 00:55:49 +08:00
|
|
|
AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
|
2005-03-20 12:01:25 +08:00
|
|
|
// testing attribute functionalities in tattr.cpp
|
2010-02-27 00:55:49 +08:00
|
|
|
AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL);
|
2006-10-22 16:24:24 +08:00
|
|
|
// testing reference functionalities in trefer.cpp
|
2010-02-27 00:55:49 +08:00
|
|
|
AddTest("trefer", test_reference, cleanup_reference, "References", NULL);
|
2007-01-02 10:17:36 +08:00
|
|
|
// testing variable-length strings in tvlstr.cpp
|
2010-02-27 00:55:49 +08:00
|
|
|
AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
|
|
|
|
AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL);
|
|
|
|
AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL);
|
|
|
|
AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL);
|
|
|
|
AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL);
|
2005-03-20 12:01:25 +08:00
|
|
|
/* Comment out tests that are not done yet. - BMR, Feb 2001
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("select", test_select, cleanup_select, "Selections", NULL);
|
|
|
|
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
|
|
|
|
AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
|
|
|
|
AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
|
|
|
|
AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL);
|
|
|
|
AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL);
|
2007-01-26 13:40:17 +08:00
|
|
|
AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL);
|
|
|
|
|
2001-03-14 21:27:13 +08:00
|
|
|
Comment out tests that are not done yet */
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2007-01-26 13:40:17 +08:00
|
|
|
/* Tentative - BMR 2007/1/12
|
|
|
|
AddTest("datatypes", test_dtypes, cleanup_dtypes, "Data Types", NULL);
|
|
|
|
AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL);
|
|
|
|
*/
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Display testing information */
|
|
|
|
TestInfo(argv[0]);
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Parse command line arguments */
|
2004-08-19 14:32:47 +08:00
|
|
|
TestParseCmdLine(argc,argv);
|
2001-03-06 07:09:59 +08:00
|
|
|
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Perform requested testing */
|
|
|
|
PerformTests();
|
2001-03-06 07:09:59 +08:00
|
|
|
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Display test summary, if requested */
|
2004-08-19 14:32:47 +08:00
|
|
|
if (GetTestSummary())
|
2004-01-10 09:41:13 +08:00
|
|
|
TestSummary();
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2004-01-10 09:41:13 +08:00
|
|
|
/* Clean up test files, if allowed */
|
2004-08-19 14:32:47 +08:00
|
|
|
if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
2004-01-10 09:41:13 +08:00
|
|
|
TestCleanup();
|
2001-03-02 02:07:25 +08:00
|
|
|
|
2004-01-10 09:41:13 +08:00
|
|
|
return (GetTestNumErrs());
|
2001-03-06 07:09:59 +08:00
|
|
|
}
|