migrated tags for tests and added missing raw files (#206)
All checks were successful
Build on RHEL8 / build (push) Successful in 2m57s
Build on RHEL9 / build (push) Successful in 2m59s

- No changes or evaluation of existing tests
- Tags for including tests that require data is changed to
**[.with-data]** and **--with-data** for C++ and python respectively
- Minor update to docs
- Added missing files to the test data repo
This commit is contained in:
Erik Fröjdh
2025-06-26 17:11:20 +02:00
committed by GitHub
parent 30822d9c5f
commit 6ec8fbee72
13 changed files with 59 additions and 58 deletions

View File

@@ -10,7 +10,7 @@ using aare::Cluster;
using aare::ClusterFile;
using aare::ClusterVector;
TEST_CASE("Read one frame from a cluster file", "[.files]") {
TEST_CASE("Read one frame from a cluster file", "[.with-data]") {
// We know that the frame has 97 clusters
auto fpath = test_data_path() / "clust" / "single_frame_97_clustrers.clust";
REQUIRE(std::filesystem::exists(fpath));
@@ -26,7 +26,7 @@ TEST_CASE("Read one frame from a cluster file", "[.files]") {
std::begin(expected_cluster_data)));
}
TEST_CASE("Read one frame using ROI", "[.files]") {
TEST_CASE("Read one frame using ROI", "[.with-data]") {
// We know that the frame has 97 clusters
auto fpath = test_data_path() / "clust" / "single_frame_97_clustrers.clust";
REQUIRE(std::filesystem::exists(fpath));
@@ -58,7 +58,7 @@ TEST_CASE("Read one frame using ROI", "[.files]") {
std::begin(expected_cluster_data)));
}
TEST_CASE("Read clusters from single frame file", "[.files]") {
TEST_CASE("Read clusters from single frame file", "[.with-data]") {
// frame_number, num_clusters [135] 97
// [ 1 200] [0 1 2 3 4 5 6 7 8]
@@ -202,7 +202,7 @@ TEST_CASE("Read clusters from single frame file", "[.files]") {
}
}
TEST_CASE("Read clusters from single frame file with ROI", "[.files]") {
TEST_CASE("Read clusters from single frame file with ROI", "[.with-data]") {
auto fpath = test_data_path() / "clust" / "single_frame_97_clustrers.clust";
REQUIRE(std::filesystem::exists(fpath));
@@ -226,7 +226,7 @@ TEST_CASE("Read clusters from single frame file with ROI", "[.files]") {
std::begin(expected_cluster_data)));
}
TEST_CASE("Read cluster from multiple frame file", "[.files]") {
TEST_CASE("Read cluster from multiple frame file", "[.with-data]") {
using ClusterType = Cluster<double, 2, 2>;
@@ -279,7 +279,7 @@ TEST_CASE("Read cluster from multiple frame file", "[.files]") {
}
}
TEST_CASE("Write cluster with potential padding", "[.files][.ClusterFile]") {
TEST_CASE("Write cluster with potential padding", "[.with-data][.ClusterFile]") {
using ClusterType = Cluster<double, 3, 3>;
@@ -324,7 +324,7 @@ TEST_CASE("Write cluster with potential padding", "[.files][.ClusterFile]") {
}));
}
TEST_CASE("Read frame and modify cluster data", "[.files][.ClusterFile]") {
TEST_CASE("Read frame and modify cluster data", "[.with-data][.ClusterFile]") {
auto fpath = test_data_path() / "clust" / "single_frame_97_clustrers.clust";
REQUIRE(std::filesystem::exists(fpath));

View File

@@ -57,9 +57,9 @@ class ClusterFinderMTWrapper
size_t m_sink_size() const { return this->m_sink.sizeGuess(); }
};
TEST_CASE("multithreaded cluster finder", "[.files][.ClusterFinder]") {
TEST_CASE("multithreaded cluster finder", "[.with-data]") {
auto fpath =
test_data_path() / "clust/Moench03new/cu_half_speed_master_4.json";
test_data_path() / "raw/moench03/cu_half_speed_master_4.json";
REQUIRE(std::filesystem::exists(fpath));

View File

@@ -5,7 +5,7 @@
using aare::JungfrauDataFile;
using aare::JungfrauDataHeader;
TEST_CASE("Open a Jungfrau data file", "[.files]") {
TEST_CASE("Open a Jungfrau data file", "[.with-data]") {
// we know we have 4 files with 7, 7, 7, and 3 frames
// firs frame number if 1 and the bunch id is frame_number**2
// so we can check the header
@@ -37,7 +37,7 @@ TEST_CASE("Open a Jungfrau data file", "[.files]") {
}
}
TEST_CASE("Seek in a JungfrauDataFile", "[.files]") {
TEST_CASE("Seek in a JungfrauDataFile", "[.with-data]") {
auto fpath = test_data_path() / "dat" / "AldoJF65k_000000.dat";
REQUIRE(std::filesystem::exists(fpath));
@@ -70,7 +70,7 @@ TEST_CASE("Seek in a JungfrauDataFile", "[.files]") {
REQUIRE_THROWS(f.seek(86356)); // out of range
}
TEST_CASE("Open a Jungfrau data file with non zero file index", "[.files]") {
TEST_CASE("Open a Jungfrau data file with non zero file index", "[.with-data]") {
auto fpath = test_data_path() / "dat" / "AldoJF65k_000003.dat";
REQUIRE(std::filesystem::exists(fpath));
@@ -94,7 +94,7 @@ TEST_CASE("Open a Jungfrau data file with non zero file index", "[.files]") {
REQUIRE(f.current_file().stem() == "AldoJF65k_000003");
}
TEST_CASE("Read into throws if size doesn't match", "[.files]") {
TEST_CASE("Read into throws if size doesn't match", "[.with-data]") {
auto fpath = test_data_path() / "dat" / "AldoJF65k_000000.dat";
REQUIRE(std::filesystem::exists(fpath));

View File

@@ -6,7 +6,7 @@
using aare::Dtype;
using aare::NumpyFile;
TEST_CASE("Read a 1D numpy file with int32 data type", "[.integration]") {
TEST_CASE("Read a 1D numpy file with int32 data type", "[.with-data]") {
auto fpath = test_data_path() / "numpy" / "test_1d_int32.npy";
REQUIRE(std::filesystem::exists(fpath));
@@ -24,7 +24,7 @@ TEST_CASE("Read a 1D numpy file with int32 data type", "[.integration]") {
}
}
TEST_CASE("Read a 3D numpy file with np.double data type", "[.integration]") {
TEST_CASE("Read a 3D numpy file with np.double data type", "[.with-data]") {
auto fpath = test_data_path() / "numpy" / "test_3d_double.npy";
REQUIRE(std::filesystem::exists(fpath));

View File

@@ -13,19 +13,19 @@ using aare::File;
using aare::RawFile;
using namespace aare;
TEST_CASE("Read number of frames from a jungfrau raw file", "[.integration]") {
TEST_CASE("Read number of frames from a jungfrau raw file", "[.with-data]") {
auto fpath =
test_data_path() / "jungfrau" / "jungfrau_single_master_0.json";
test_data_path() / "raw/jungfrau/jungfrau_single_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
REQUIRE(f.total_frames() == 10);
}
TEST_CASE("Read frame numbers from a jungfrau raw file", "[.integration]") {
TEST_CASE("Read frame numbers from a jungfrau raw file", "[.with-data]") {
auto fpath =
test_data_path() / "jungfrau" / "jungfrau_single_master_0.json";
test_data_path() / "raw/jungfrau/jungfrau_single_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
@@ -40,9 +40,9 @@ TEST_CASE("Read frame numbers from a jungfrau raw file", "[.integration]") {
}
}
TEST_CASE("Read a frame number too high throws", "[.integration]") {
TEST_CASE("Read a frame number too high throws", "[.with-data]") {
auto fpath =
test_data_path() / "jungfrau" / "jungfrau_single_master_0.json";
test_data_path() / "raw/jungfrau/jungfrau_single_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
@@ -56,9 +56,10 @@ TEST_CASE("Read a frame number too high throws", "[.integration]") {
}
TEST_CASE("Read a frame numbers where the subfile is missing throws",
"[.integration]") {
auto fpath = test_data_path() / "jungfrau" /
"[.with-data]") {
auto fpath = test_data_path() / "raw/jungfrau" /
"jungfrau_missing_subfile_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
@@ -78,9 +79,9 @@ TEST_CASE("Read a frame numbers where the subfile is missing throws",
}
TEST_CASE("Read data from a jungfrau 500k single port raw file",
"[.integration]") {
"[.with-data]") {
auto fpath =
test_data_path() / "jungfrau" / "jungfrau_single_master_0.json";
test_data_path() / "raw/jungfrau/jungfrau_single_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
@@ -97,8 +98,8 @@ TEST_CASE("Read data from a jungfrau 500k single port raw file",
}
}
TEST_CASE("Read frame numbers from a raw file", "[.integration]") {
auto fpath = test_data_path() / "eiger" / "eiger_500k_16bit_master_0.json";
TEST_CASE("Read frame numbers from a raw file", "[.with-data]") {
auto fpath = test_data_path() / "raw/eiger" / "eiger_500k_16bit_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
// we know this file has 3 frames with frame numbers 14, 15, 16
@@ -110,7 +111,7 @@ TEST_CASE("Read frame numbers from a raw file", "[.integration]") {
}
}
TEST_CASE("Compare reading from a numpy file with a raw file", "[.files]") {
TEST_CASE("Compare reading from a numpy file with a raw file", "[.with-data]") {
SECTION("jungfrau data") {
auto fpath_raw =
@@ -173,9 +174,9 @@ TEST_CASE("Compare reading from a numpy file with a raw file", "[.files]") {
}
}
TEST_CASE("Read multipart files", "[.integration]") {
TEST_CASE("Read multipart files", "[.with-data]") {
auto fpath =
test_data_path() / "jungfrau" / "jungfrau_double_master_0.json";
test_data_path() / "raw/jungfrau" / "jungfrau_double_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath, "r");
@@ -214,7 +215,7 @@ struct TestParameters {
std::vector<ModuleGeometry> module_geometries{};
};
TEST_CASE("check find_geometry", "[.integration][.files][.rawfile]") {
TEST_CASE("check find_geometry", "[.with-data]") {
auto test_parameters = GENERATE(
TestParameters{"raw/jungfrau_2modules_version6.1.2/run_master_0.raw", 2,
@@ -288,7 +289,7 @@ TEST_CASE("check find_geometry", "[.integration][.files][.rawfile]") {
}
TEST_CASE("Open multi module file with ROI",
"[.integration][.files][.rawfile]") {
"[.with-data]") {
auto fpath = test_data_path() / "raw/SingleChipROI/Data_master_0.json";
REQUIRE(std::filesystem::exists(fpath));
@@ -312,9 +313,9 @@ TEST_CASE("Open multi module file with ROI",
}
}
TEST_CASE("Read file with unordered frames", "[.integration]") {
TEST_CASE("Read file with unordered frames", "[.with-data]") {
// TODO! Better explanation and error message
auto fpath = test_data_path() / "mythen" / "scan242_master_3.raw";
auto fpath = test_data_path() / "raw/mythen/scan242_master_3.raw";
REQUIRE(std::filesystem::exists(fpath));
File f(fpath);
REQUIRE_THROWS((f.read_frame()));

View File

@@ -147,7 +147,7 @@ TEST_CASE("Parse a master file in .json format", "[.integration]") {
}
TEST_CASE("Parse a master file in old .raw format",
"[.integration][.files][.rawmasterfile]") {
"[.integration][.with-data][.rawmasterfile]") {
auto fpath = test_data_path() /
"raw/jungfrau_2modules_version6.1.2/run_master_0.raw";
REQUIRE(std::filesystem::exists(fpath));

View File

@@ -6,7 +6,7 @@
using namespace aare;
TEST_CASE("Read frames directly from a RawSubFile", "[.files]") {
TEST_CASE("Read frames directly from a RawSubFile", "[.with-data]") {
auto fpath_raw =
test_data_path() / "raw/jungfrau" / "jungfrau_single_d0_f0_0.raw";
REQUIRE(std::filesystem::exists(fpath_raw));
@@ -40,7 +40,7 @@ TEST_CASE("Read frames directly from a RawSubFile", "[.files]") {
}
TEST_CASE("Read frames directly from a RawSubFile starting at the second file",
"[.files]") {
"[.with-data]") {
// we know this file has 10 frames with frame numbers 1 to 10
// f0 1,2,3
// f1 4,5,6 <-- starting here