Skip to content

Commit

Permalink
Announce the tests that are being executed
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Feb 26, 2021
1 parent acefc3b commit facaa3e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RecordComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ RecordComponent::flush(std::string const& name)
Attribute a( getExtent() );
aWrite.dtype = a.dtype;
aWrite.resource = a.getResource();
IOHandler->enqueue( IOTask( this, aWrite ) );
IOHandler()->enqueue( IOTask( this, aWrite ) );
}
else
{
Parameter< Operation::EXTEND_DATASET > pExtend;
pExtend.extent = m_dataset->extent;
IOHandler->enqueue( IOTask( this, std::move( pExtend ) ) );
IOHandler()->enqueue( IOTask( this, std::move( pExtend ) ) );
*m_hasBeenExtended = false;
}
}
Expand Down
39 changes: 39 additions & 0 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ write_and_read_many_iterations( std::string const & ext ) {

TEST_CASE( "write_and_read_many_iterations", "[serial]" )
{
std::cout << "RUN TEST: write_and_read_many_iterations" << std::endl;
if( auxiliary::directory_exists( "../samples/many_iterations" ) )
auxiliary::remove_directory( "../samples/many_iterations" );
for( auto const & t : testedFileExtensions() )
Expand All @@ -89,6 +90,7 @@ TEST_CASE( "write_and_read_many_iterations", "[serial]" )

TEST_CASE( "multi_series_test", "[serial]" )
{
std::cout << "RUN TEST: multi_series_test" << std::endl;
std::list< Series > allSeries;

auto myfileExtensions = testedFileExtensions();
Expand Down Expand Up @@ -137,6 +139,7 @@ TEST_CASE( "multi_series_test", "[serial]" )

TEST_CASE( "available_chunks_test_json", "[serial][json]" )
{
std::cout << "RUN TEST: available_chunks_test_json" << std::endl;
/*
* This test is JSON specific
* Our JSON backend does not store chunks explicitly,
Expand Down Expand Up @@ -330,6 +333,7 @@ close_iteration_test( std::string file_ending )

TEST_CASE( "close_iteration_test", "[serial]" )
{
std::cout << "RUN TEST: close_iteration_test" << std::endl;
for( auto const & t : testedFileExtensions() )
{
close_iteration_test( t );
Expand Down Expand Up @@ -390,6 +394,7 @@ close_and_copy_attributable_test( std::string file_ending )

TEST_CASE( "close_and_copy_attributable_test", "[serial]" )
{
std::cout << "RUN TEST: close_and_copy_attributable_test" << std::endl;
// demonstrator for https://github.com/openPMD/openPMD-api/issues/765
for( auto const & t : testedFileExtensions() )
{
Expand All @@ -400,6 +405,7 @@ TEST_CASE( "close_and_copy_attributable_test", "[serial]" )
#if openPMD_HAVE_ADIOS2
TEST_CASE( "close_iteration_throws_test", "[serial]" )
{
std::cout << "RUN TEST: close_iteration_throws_test" << std::endl;
/*
* Iterations should not be accessed any more after closing.
* Test that the openPMD API detects that case and throws.
Expand Down Expand Up @@ -538,6 +544,7 @@ empty_dataset_test( std::string file_ending )

TEST_CASE( "empty_dataset_test", "[serial]" )
{
std::cout << "RUN TEST: empty_dataset_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
empty_dataset_test( t );
Expand Down Expand Up @@ -689,6 +696,7 @@ void constant_scalar(std::string file_ending)

TEST_CASE( "constant_scalar", "[serial]" )
{
std::cout << "RUN TEST: constant_scalar" << std::endl;
for (auto const & t: testedFileExtensions())
{
constant_scalar( t );
Expand All @@ -697,6 +705,7 @@ TEST_CASE( "constant_scalar", "[serial]" )

TEST_CASE( "flush_without_position_positionOffset", "[serial]" )
{
std::cout << "RUN TEST: flush_without_position_positionOffset" << std::endl;
for( auto const & t : testedFileExtensions() )
{
const std::string & file_ending = t;
Expand Down Expand Up @@ -816,6 +825,7 @@ void particle_patches( std::string file_ending )

TEST_CASE( "particle_patches", "[serial]" )
{
std::cout << "RUN TEST: particle_patches" << std::endl;
for (auto const & t: testedFileExtensions())
{
particle_patches( t );
Expand Down Expand Up @@ -1008,6 +1018,7 @@ void dtype_test( const std::string & backend )

TEST_CASE( "dtype_test", "[serial]" )
{
std::cout << "RUN TEST: dtype_test" << std::endl;
for (auto const & t: testedFileExtensions())
dtype_test(t);
}
Expand Down Expand Up @@ -1094,6 +1105,7 @@ void write_test(const std::string & backend)

TEST_CASE( "write_test", "[serial]" )
{
std::cout << "RUN TEST: write_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
write_test( t );
Expand Down Expand Up @@ -1172,6 +1184,7 @@ void test_complex(const std::string & backend) {

TEST_CASE( "test_complex", "[serial]" )
{
std::cout << "RUN TEST: test_complex" << std::endl;
// Notes:
// - ADIOS1 and ADIOS 2.7.0 have no complex long double
// - JSON read-back not distinguishable yet from N+1 shaped data set
Expand Down Expand Up @@ -1435,6 +1448,7 @@ void fileBased_write_test(const std::string & backend)

TEST_CASE( "fileBased_write_test", "[serial]" )
{
std::cout << "RUN TEST: fileBased_write_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
fileBased_write_test( t );
Expand Down Expand Up @@ -1510,6 +1524,7 @@ void sample_write_thetaMode(std::string file_ending)

TEST_CASE( "sample_write_thetaMode", "[serial][thetaMode]" )
{
std::cout << "RUN TEST: sample_write_thetaMode" << std::endl;
for (auto const & t: testedFileExtensions())
{
sample_write_thetaMode( t );
Expand Down Expand Up @@ -1545,6 +1560,7 @@ void bool_test(const std::string & backend)

TEST_CASE( "bool_test", "[serial]" )
{
std::cout << "RUN TEST: bool_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
bool_test( t );
Expand Down Expand Up @@ -1582,6 +1598,7 @@ void patch_test(const std::string & backend)

TEST_CASE( "patch_test", "[serial]" )
{
std::cout << "RUN TEST: patch_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
patch_test( t );
Expand Down Expand Up @@ -1639,6 +1656,7 @@ void deletion_test(const std::string & backend)

TEST_CASE( "deletion_test", "[serial]" )
{
std::cout << "RUN TEST: deletion_test" << std::endl;
for (auto const & t: testedFileExtensions())
{
if (t == "bp")
Expand All @@ -1664,6 +1682,7 @@ void read_missing_throw_test(const std::string & backend)

TEST_CASE( "read_missing_throw_test", "[serial]" )
{
std::cout << "RUN TEST: read_missing_throw_test" << std::endl;
for (auto const & t: testedFileExtensions())
read_missing_throw_test( t );
}
Expand Down Expand Up @@ -1734,6 +1753,7 @@ void optional_paths_110_test(const std::string & backend)
#if openPMD_HAVE_HDF5
TEST_CASE( "empty_alternate_fbpic", "[serial][hdf5]" )
{
std::cout << "RUN TEST: empty_alternate_fbpic" << std::endl;
// Ref.: https://github.com/openPMD/openPMD-viewer/issues/296
try
{
Expand Down Expand Up @@ -1762,6 +1782,7 @@ TEST_CASE( "empty_alternate_fbpic", "[serial][hdf5]" )

TEST_CASE( "available_chunks_test_hdf5", "[serial][json]" )
{
std::cout << "RUN TEST: available_chunks_test_hdf5" << std::endl;
/*
* This test is HDF5 specific
* HDF5 does not store chunks explicitly,
Expand Down Expand Up @@ -1808,11 +1829,13 @@ TEST_CASE( "available_chunks_test_hdf5", "[serial][json]" )

TEST_CASE( "optional_paths_110_test", "[serial]" )
{
std::cout << "RUN TEST: optional_paths_110_test" << std::endl;
optional_paths_110_test("h5"); // samples only present for hdf5
}

TEST_CASE( "git_hdf5_sample_structure_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: git_hdf5_sample_structure_test" << std::endl;
#if openPMD_USE_INVASIVE_TESTS
try
{
Expand Down Expand Up @@ -1867,6 +1890,7 @@ TEST_CASE( "git_hdf5_sample_structure_test", "[serial][hdf5]" )

TEST_CASE( "git_hdf5_sample_attribute_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: git_hdf5_sample_attribute_test" << std::endl;
try
{
Series o = Series("../samples/git-sample/data%T.h5", Access::READ_ONLY);
Expand Down Expand Up @@ -2116,6 +2140,7 @@ TEST_CASE( "git_hdf5_sample_attribute_test", "[serial][hdf5]" )

TEST_CASE( "git_hdf5_sample_content_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: git_hdf5_sample_content_test" << std::endl;
try
{
Series o = Series("../samples/git-sample/data%T.h5", Access::READ_ONLY);
Expand Down Expand Up @@ -2167,6 +2192,7 @@ TEST_CASE( "git_hdf5_sample_content_test", "[serial][hdf5]" )

TEST_CASE( "git_hdf5_sample_fileBased_read_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: git_hdf5_sample_fileBased_read_test" << std::endl;
try
{
Series o = Series("../samples/git-sample/data%T.h5", Access::READ_ONLY);
Expand Down Expand Up @@ -2251,6 +2277,7 @@ TEST_CASE( "git_hdf5_sample_fileBased_read_test", "[serial][hdf5]" )

TEST_CASE( "git_hdf5_sample_read_thetaMode", "[serial][hdf5][thetaMode]" )
{
std::cout << "RUN TEST: git_hdf5_sample_read_thetaMode" << std::endl;
try
{
Series o = Series("../samples/git-sample/thetaMode/data%T.h5", Access::READ_ONLY);
Expand Down Expand Up @@ -2316,6 +2343,7 @@ TEST_CASE( "git_hdf5_sample_read_thetaMode", "[serial][hdf5][thetaMode]" )

TEST_CASE( "hzdr_hdf5_sample_content_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: hzdr_hdf5_sample_content_test" << std::endl;
// since this file might not be publicly available, gracefully handle errors
try
{
Expand Down Expand Up @@ -2752,28 +2780,33 @@ TEST_CASE( "hzdr_hdf5_sample_content_test", "[serial][hdf5]" )

TEST_CASE( "hdf5_bool_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: hdf5_bool_test" << std::endl;
bool_test("h5");
}

TEST_CASE( "hdf5_patch_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: hdf5_patch_test" << std::endl;
patch_test("h5");
}

TEST_CASE( "hdf5_deletion_test", "[serial][hdf5]" )
{
std::cout << "RUN TEST: hdf5_deletion_test" << std::endl;
deletion_test("h5");
}
#else
TEST_CASE( "no_serial_hdf5", "[serial][hdf5]" )
{
std::cout << "RUN TEST: no_serial_hdf5" << std::endl;
REQUIRE(true);
}
#endif
#if openPMD_HAVE_ADIOS1

TEST_CASE( "hzdr_adios1_sample_content_test", "[serial][adios1]" )
{
std::cout << "RUN TEST: hzdr_adios1_sample_content_test" << std::endl;
// since this file might not be publicly available, gracefully handle errors
/** @todo add bp example files to https://github.com/openPMD/openPMD-example-datasets */
try
Expand Down Expand Up @@ -2936,13 +2969,15 @@ TEST_CASE( "hzdr_adios1_sample_content_test", "[serial][adios1]" )
#else
TEST_CASE( "no_serial_adios1", "[serial][adios]")
{
std::cout << "RUN TEST: no_serial_adios1" << std::endl;
REQUIRE(true);
}
#endif

#if openPMD_HAVE_ADIOS2
TEST_CASE( "serial_adios2_json_config", "[serial][adios2]" )
{
std::cout << "RUN TEST: serial_adios2_json_config" << std::endl;
if( auxiliary::getEnvString( "OPENPMD_BP_BACKEND", "NOT_SET" ) == "ADIOS1" )
{
// run this test for ADIOS2 only
Expand Down Expand Up @@ -3170,6 +3205,7 @@ bp4_steps( std::string const & file, std::string const & options_write, std::str

TEST_CASE( "bp4_steps", "[serial][adios2]" )
{
std::cout << "RUN TEST: bp4_steps" << std::endl;
std::string useSteps = R"(
{
"adios2": {
Expand Down Expand Up @@ -3293,6 +3329,7 @@ serial_iterator( std::string const & file )

TEST_CASE( "serial_iterator", "[serial][adios2]" )
{
std::cout << "RUN TEST: serial_iterator" << std::endl;
for( auto const & t : testedFileExtensions() )
{
serial_iterator( "../samples/serial_iterator_filebased_%T." + t );
Expand Down Expand Up @@ -3361,6 +3398,7 @@ iterate_nonstreaming_series( std::string const & file )

TEST_CASE( "iterate_nonstreaming_series", "[serial][adios2]" )
{
std::cout << "RUN TEST: iterate_nonstreaming_series" << std::endl;
for( auto const & t : testedFileExtensions() )
{
iterate_nonstreaming_series(
Expand Down Expand Up @@ -3497,6 +3535,7 @@ extendDataset( std::string const & ext )

TEST_CASE( "extend_dataset", "[serial]" )
{
std::cout << "RUN TEST: extend_dataset" << std::endl;
extendDataset( "json" );
#if openPMD_HAVE_ADIOS2
extendDataset( "bp" );
Expand Down

0 comments on commit facaa3e

Please sign in to comment.