Skip to content

Commit

Permalink
Run CTest with -j2.
Browse files Browse the repository at this point in the history
This should manifest in spurious failure if filenames are
reused.
  • Loading branch information
1uc committed Sep 14, 2023
1 parent 75fa31e commit 84d2b26
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE


# Job testing several versions of hdf5
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE


- name: Examples
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE

- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE

- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE

- name: Examples
working-directory: ${{github.workspace}}/build/src/examples
Expand Down Expand Up @@ -348,4 +348,4 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash -l {0}
run: ctest --output-on-failure -C $BUILD_TYPE
run: ctest -j2 --output-on-failure -C $BUILD_TYPE
4 changes: 2 additions & 2 deletions tests/unit/test_all_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using namespace HighFive;

TEMPLATE_TEST_CASE("Scalar in DataSet", "[Types]", bool, std::string) {
const std::string FILE_NAME("rw_dataset" + typeNameHelper<TestType>() + ".h5");
const std::string FILE_NAME("rw_dataset_" + typeNameHelper<TestType>() + ".h5");
const std::string DATASET_NAME("dset");
TestType t1{};

Expand Down Expand Up @@ -52,7 +52,7 @@ TEMPLATE_TEST_CASE("Scalar in DataSet", "[Types]", bool, std::string) {
}

TEMPLATE_PRODUCT_TEST_CASE("Scalar in std::vector", "[Types]", std::vector, (bool, std::string)) {
const std::string FILE_NAME("rw_dataset" + typeNameHelper<TestType>() + ".h5");
const std::string FILE_NAME("rw_dataset_" + typeNameHelper<TestType>() + ".h5");
const std::string DATASET_NAME("dset");
TestType t1(5);

Expand Down
19 changes: 14 additions & 5 deletions tests/unit/tests_high_five.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include <string>
#include <vector>
#include <tuple>
#include <sstream>
#include <functional>
#include <iomanip>

// We don't need windows specific functionality. However, to better detect defects caused by macros,
// we include this header.
Expand Down Expand Up @@ -162,16 +165,22 @@ struct ContentGenerate<std::string> {
template <typename T>
inline std::string typeNameHelper() {
std::string name = typeid(T).name();
#if defined(WIN32)
// Replace illegal windows file path characters
std::replace(std::begin(name), std::end(name), ' ', '_');
std::replace(std::begin(name), std::end(name), '<', '_');
std::replace(std::begin(name), std::end(name), '>', '_');
std::replace(std::begin(name), std::end(name), ':', '_');
#endif
return name;

if (name.size() > 64) {
std::stringstream hash;
hash << std::hex << std::hash<std::string>{}(name);

return hash.str();
} else {
return name;
}
}


template <typename ElemT, typename DataT>
inline HighFive::DataSet readWriteDataset(const DataT& ndvec,
DataT& result,
Expand All @@ -193,4 +202,4 @@ inline HighFive::DataSet readWriteDataset(const DataT& ndvec,

dataset.read(result);
return dataset;
}
}

0 comments on commit 84d2b26

Please sign in to comment.