mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-07-11 18:31:51 +02:00
check master file creation as well in rx_roi tests
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include "test-Caller-global.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <filesystem>
|
||||
|
||||
#include "sls/versionAPI.h"
|
||||
#include "tests/globals.h"
|
||||
@ -686,6 +687,46 @@ TEST_CASE("rx_roi", "[.cmdcall]") {
|
||||
}
|
||||
}
|
||||
|
||||
// check master file creation
|
||||
// TODO: check roi in master file
|
||||
{
|
||||
auto prev_write = det.getFileWrite().tsquash(
|
||||
"inconsistent file write values in test");
|
||||
auto prev_path = det.getFilePath().tsquash(
|
||||
"inconsistent file path values in test");
|
||||
auto prev_format = det.getFileFormat().tsquash(
|
||||
"inconsistent file format values in test");
|
||||
auto prev_index = det.getAcquisitionIndex().tsquash(
|
||||
"inconsistent file index values in test");
|
||||
auto prev_fname = det.getFileNamePrefix().tsquash(
|
||||
"inconsistent file name prefix values in test");
|
||||
|
||||
det.setFileWrite(true);
|
||||
det.setFilePath("/tmp");
|
||||
det.setFileNamePrefix("test");
|
||||
|
||||
det.setAcquisitionIndex(0);
|
||||
det.setFileFormat(defs::BINARY);
|
||||
REQUIRE_NOTHROW(caller.call("acquire", {}, -1, PUT));
|
||||
std::string file_path = "/tmp/test_master_0.json";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
|
||||
det.setAcquisitionIndex(0);
|
||||
det.setFileFormat(defs::HDF5);
|
||||
REQUIRE_NOTHROW(caller.call("acquire", {}, -1, PUT));
|
||||
file_path = "/tmp/test_master_0.h5";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
file_path = "/tmp/test_virtual_0.h5";
|
||||
REQUIRE(std::filesystem::exists(file_path) == true);
|
||||
|
||||
det.setFileWrite(prev_write);
|
||||
if (!prev_path.empty())
|
||||
det.setFilePath(prev_path);
|
||||
det.setFileFormat(prev_format);
|
||||
det.setAcquisitionIndex(prev_index);
|
||||
det.setFileNamePrefix(prev_fname);
|
||||
}
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setRxROI(prev_val);
|
||||
}
|
||||
|
@ -56,12 +56,14 @@ def loadConfigForRoi(name, fp, num_mods = 1, num_interfaces = 1):
|
||||
d.udp_srcip = 'auto'
|
||||
if name == 'jungfrau' or name == 'moench':
|
||||
d.udp_dstip2 = 'auto'
|
||||
d.powerchip = 1
|
||||
|
||||
d.frames = 5
|
||||
|
||||
except Exception as e:
|
||||
raise RuntimeException(f'Could not load config for {name}. Error: {str(e)}') from e
|
||||
|
||||
|
||||
|
||||
|
||||
return d
|
||||
|
||||
def startTestsForAll(fp):
|
||||
servers = [
|
||||
@ -85,7 +87,7 @@ def startTestsForAll(fp):
|
||||
cleanup(fp)
|
||||
startDetectorVirtualServer(server, nmods, fp)
|
||||
startReceiver(nmods, fp)
|
||||
loadConfigForRoi(name=server, fp=fp, num_mods=nmods, num_interfaces=ninterfaces)
|
||||
d = loadConfigForRoi(name=server, fp=fp, num_mods=nmods, num_interfaces=ninterfaces)
|
||||
|
||||
fname = ROI_TEST_FNAME + server + '.txt'
|
||||
cmd = ['tests', 'rx_roi', '--abort', '-s']
|
||||
|
Reference in New Issue
Block a user