diff --git a/docs/src/Testing.rst b/docs/src/Testing.rst index 515571788..4371ee956 100644 --- a/docs/src/Testing.rst +++ b/docs/src/Testing.rst @@ -68,7 +68,7 @@ If you want to run them for a specific virtual detector or a specific test use t .. code-block:: console cd build - python bin/test_simulators.py --servers jungfrau --test "[.rx]" + python bin/test_simulators.py --servers jungfrau --test "[dacs]" You can exclude specific tests by adding the option ``~[]``. Again, we assume that this marker is added to the tests that you want to exclude. diff --git a/slsDetectorSoftware/tests/CMakeLists.txt b/slsDetectorSoftware/tests/CMakeLists.txt index d547abc4b..d25b35718 100755 --- a/slsDetectorSoftware/tests/CMakeLists.txt +++ b/slsDetectorSoftware/tests/CMakeLists.txt @@ -4,7 +4,6 @@ target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-SharedMemory.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test-slsDetector.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Caller/test-Caller-rx.cpp diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp index 44ae67c14..94e294ab7 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp @@ -20,7 +20,7 @@ using test::PUT; // sysctl net.core.rmem_max=$((100*1024*1024)) // sysctl net.core.rmem_default=$((100*1024*1024)) TEST_CASE("jungfrau_or_moench_acquire_check_file_size", - "[.detectorintegration][.cmdacquire][.disable_check_data_file]") { + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); @@ -51,7 +51,7 @@ TEST_CASE("jungfrau_or_moench_acquire_check_file_size", } TEST_CASE("eiger_acquire_check_file_size", - "[.detectorintegration][.cmdacquire][.disable_check_data_file]") { + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); auto det_type = @@ -83,7 +83,7 @@ TEST_CASE("eiger_acquire_check_file_size", } TEST_CASE("mythen3_acquire_check_file_size", - "[.detectorintegration][.cmdacquire][.disable_check_data_file]") { + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); auto det_type = @@ -117,7 +117,7 @@ TEST_CASE("mythen3_acquire_check_file_size", } TEST_CASE("gotthard2_acquire_check_file_size", - "[.detectorintegration][.cmdacquire][.disable_check_data_file]") { + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); auto det_type = @@ -160,7 +160,7 @@ void test_ctb_file_size_with_acquire(Detector &det, Caller &caller, // sysctl net.core.rmem_max=$((100*1024*1024)) // sysctl net.core.rmem_default=$((100*1024*1024)) TEST_CASE("ctb_acquire_check_file_size", - "[.detectorintegration][.cmdacquire][.disable_check_data_file]") { + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); auto det_type = diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-chiptestboard.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-chiptestboard.cpp index b9f63a4bd..404999108 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-chiptestboard.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-chiptestboard.cpp @@ -488,7 +488,7 @@ TEST_CASE("slowadcindex", "[.detectorintegration]") { /* dacs */ -TEST_CASE("dac", "[.detectorintegration][.dacs]") { +TEST_CASE("dac", "[.detectorintegration][dacs]") { // dac 0 to dac 17 Detector det; @@ -1395,7 +1395,7 @@ TEST_CASE("led", "[.detectorintegration]") { } } -TEST_CASE("define_reg", "[.cmdcall][.definecmds]") { +TEST_CASE("define_reg", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1473,7 +1473,7 @@ TEST_CASE("define_reg", "[.cmdcall][.definecmds]") { } } -TEST_CASE("define_bit", "[.cmdcall][.definecmds]") { +TEST_CASE("define_bit", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1570,7 +1570,7 @@ TEST_CASE("define_bit", "[.cmdcall][.definecmds]") { } TEST_CASE("using define for reg, setbit, getbit and clearbit", - "[.cmdcall][.definecmds]") { + "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1684,7 +1684,7 @@ TEST_CASE("using define for reg, setbit, getbit and clearbit", } } -TEST_CASE("definelist_reg", "[.cmdcall][.definecmds]") { +TEST_CASE("definelist_reg", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1717,7 +1717,7 @@ TEST_CASE("definelist_reg", "[.cmdcall][.definecmds]") { } } -TEST_CASE("definelist_bit", "[.cmdcall][.definecmds]") { +TEST_CASE("definelist_bit", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-eiger.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-eiger.cpp index 4f05256fa..5c91a50fe 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-eiger.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-eiger.cpp @@ -127,7 +127,7 @@ TEST_CASE("temp_fpgafr", "[.detectorintegration]") { /* dacs */ TEST_CASE("Setting and reading back EIGER dacs", - "[.detectorintegration][.dacs]") { + "[.detectorintegration][dacs]") { // vsvp, vtr, vrf, vrs, vsvn, vtgstv, vcmp_ll, vcmp_lr, vcal, vcmp_rl, // rxb_rb, rxb_lb, vcmp_rr, vcp, vcn, vis, vthreshold Detector det; diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-gotthard2.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-gotthard2.cpp index b5264f5b7..f70332e40 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-gotthard2.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-gotthard2.cpp @@ -107,7 +107,7 @@ TEST_CASE("timegotthard2", "[.detectorintegration]") { /* dacs */ TEST_CASE("Setting and reading back GOTTHARD2 dacs", - "[.detectorintegration][.dacs]") { + "[.detectorintegration][dacs]") { // vref_h_adc, vb_comp_fe, vb_comp_adc, vcom_cds, // vref_restore, vb_opa_1st, vref_comp_fe, vcom_adc1, // vref_prech, vref_l_adc, vref_cds, vb_cs, @@ -216,7 +216,7 @@ TEST_CASE("Setting and reading back GOTTHARD2 dacs", /* on chip dacs */ -TEST_CASE("vchip_comp_fe", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_comp_fe", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -229,7 +229,7 @@ TEST_CASE("vchip_comp_fe", "[.detectorintegration][.onchipdacs]") { } } -TEST_CASE("vchip_opa_1st", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_opa_1st", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -242,7 +242,7 @@ TEST_CASE("vchip_opa_1st", "[.detectorintegration][.onchipdacs]") { } } -TEST_CASE("vchip_opa_fd", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_opa_fd", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -255,7 +255,7 @@ TEST_CASE("vchip_opa_fd", "[.detectorintegration][.onchipdacs]") { } } -TEST_CASE("vchip_comp_adc", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_comp_adc", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -268,7 +268,7 @@ TEST_CASE("vchip_comp_adc", "[.detectorintegration][.onchipdacs]") { } } -TEST_CASE("vchip_ref_comp_fe", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_ref_comp_fe", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -282,7 +282,7 @@ TEST_CASE("vchip_ref_comp_fe", "[.detectorintegration][.onchipdacs]") { } } -TEST_CASE("vchip_cs", "[.detectorintegration][.onchipdacs]") { +TEST_CASE("vchip_cs", "[.detectorintegration][dacs]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp index 02334f40f..629757728 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp @@ -18,7 +18,7 @@ using test::PUT; /* dacs */ TEST_CASE("Setting and reading back Jungfrau dacs", - "[.detectorintegration][.dacs]") { + "[.detectorintegration][dacs]") { // vb_comp, vdd_prot, vin_com, vref_prech, vb_pixbuf, vb_ds, vref_ds, // vref_comp Detector det; diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-master-attributes.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-master-attributes.cpp index 4d0e0a6f5..4d3c5faef 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-master-attributes.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-master-attributes.cpp @@ -1032,9 +1032,8 @@ void open_hdf5_file(const std::string &file_path) { } #endif -TEST_CASE( - "check_master_file_attributes", - "[.detectorintegration][.cmdacquire][.cmdattr][.disable_check_data_file]") { +TEST_CASE("check_master_file_attributes", + "[.detectorintegration][.disable_check_data_file]") { Detector det; Caller caller(&det); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-moench.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-moench.cpp index 17ee3be1a..4a4a93e3f 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-moench.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-moench.cpp @@ -18,7 +18,7 @@ using test::PUT; /* dacs */ TEST_CASE("Setting and reading back moench dacs", - "[.detectorintegration][.dacs]") { + "[.detectorintegration][dacs]") { // vbp_colbuf, vipre, vin_cm, vb_sda, vcasc_sfp, vout_cm, vipre_cds, // ibias_sfp Detector det; diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-mythen3.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-mythen3.cpp index 602d0b2db..35345699f 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-mythen3.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-mythen3.cpp @@ -20,7 +20,7 @@ using test::PUT; /* dacs */ TEST_CASE("Setting and reading back MYTHEN3 dacs", - "[.detectorintegration][.dacs]") { + "[.detectorintegration][dacs]") { // vcassh, vth2, vshaper, vshaperneg, vipre_out, vth3, vth1, // vicin, vcas, vpreamp, vpl, vipre, viinsh, vph, vtrim, vdcsh, diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp index dc736e27a..85ab76599 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-rx-running.cpp @@ -12,7 +12,7 @@ namespace sls { using test::PUT; TEST_CASE("Ctb and xilinx - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -61,7 +61,7 @@ TEST_CASE("Ctb and xilinx - cant put if receiver is not idle", } TEST_CASE("adcenable - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -85,7 +85,7 @@ TEST_CASE("adcenable - cant put if receiver is not idle", } TEST_CASE("bursts - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -108,7 +108,7 @@ TEST_CASE("bursts - cant put if receiver is not idle", } TEST_CASE("counters - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -132,7 +132,7 @@ TEST_CASE("counters - cant put if receiver is not idle", } TEST_CASE("numinterfaces - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -154,8 +154,7 @@ TEST_CASE("numinterfaces - cant put if receiver is not idle", } } -TEST_CASE("dr - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { +TEST_CASE("dr - cant put if receiver is not idle", "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -178,7 +177,7 @@ TEST_CASE("dr - cant put if receiver is not idle", } TEST_CASE("tengiga - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); @@ -203,7 +202,7 @@ TEST_CASE("tengiga - cant put if receiver is not idle", } TEST_CASE("general - cant put if receiver is not idle", - "[.detectorintegration][.rx]") { + "[.detectorintegration]") { Detector det; Caller caller(&det); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp index 1e489b0b0..828f16316 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp @@ -25,7 +25,7 @@ python/scripts/list_tested_cmd.py to check if all commands are covered /* configuration */ -TEST_CASE("rx_version", "[.detectorintegration][.rx]") { +TEST_CASE("rx_version", "[.detectorintegration]") { Detector det; Caller caller(&det); std::ostringstream oss; @@ -39,7 +39,7 @@ TEST_CASE("rx_version", "[.detectorintegration][.rx]") { } /* acquisition */ -TEST_CASE("rx_start", "[.detectorintegration][.rx]") { +TEST_CASE("rx_start", "[.detectorintegration]") { Detector det; Caller caller(&det); det.setFileWrite(false); // avoid writing or error on file creation @@ -57,7 +57,7 @@ TEST_CASE("rx_start", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_stop", "[.detectorintegration][.rx]") { +TEST_CASE("rx_stop", "[.detectorintegration]") { Detector det; Caller caller(&det); // PUT only command @@ -74,7 +74,7 @@ TEST_CASE("rx_stop", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_status", "[.detectorintegration][.rx]") { +TEST_CASE("rx_status", "[.detectorintegration]") { Detector det; Caller caller(&det); det.setFileWrite(false); // avoid writing or error on file creation @@ -92,7 +92,7 @@ TEST_CASE("rx_status", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_framescaught", "[.detectorintegration][.rx]") { +TEST_CASE("rx_framescaught", "[.detectorintegration]") { Detector det; Caller caller(&det); // This ensures 0 caught frames @@ -126,7 +126,7 @@ TEST_CASE("rx_framescaught", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_missingpackets", "[.detectorintegration][.rx]") { +TEST_CASE("rx_missingpackets", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getFileWrite(); @@ -171,7 +171,7 @@ TEST_CASE("rx_missingpackets", "[.detectorintegration][.rx]") { det.setNumberOfFrames(prev_frames); } -TEST_CASE("rx_frameindex", "[.detectorintegration][.rx]") { +TEST_CASE("rx_frameindex", "[.detectorintegration]") { Detector det; Caller caller(&det); caller.call("rx_frameindex", {}, -1, GET); @@ -182,7 +182,7 @@ TEST_CASE("rx_frameindex", "[.detectorintegration][.rx]") { /* Network Configuration (Detector<->Receiver) */ -TEST_CASE("rx_printconfig", "[.detectorintegration][.rx]") { +TEST_CASE("rx_printconfig", "[.detectorintegration]") { Detector det; Caller caller(&det); REQUIRE_NOTHROW(caller.call("rx_printconfig", {}, -1, GET)); @@ -190,7 +190,7 @@ TEST_CASE("rx_printconfig", "[.detectorintegration][.rx]") { /* Receiver Config */ -TEST_CASE("rx_hostname", "[.detectorintegration][.rx]") { +TEST_CASE("rx_hostname", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxHostname(); @@ -222,7 +222,7 @@ TEST_CASE("rx_hostname", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_tcpport", "[.detectorintegration][.rx]") { +TEST_CASE("rx_tcpport", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxPort(); @@ -261,7 +261,7 @@ TEST_CASE("rx_tcpport", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_fifodepth", "[.detectorintegration][.rx]") { +TEST_CASE("rx_fifodepth", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxFifoDepth(); @@ -285,7 +285,7 @@ TEST_CASE("rx_fifodepth", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_silent", "[.detectorintegration][.rx]") { +TEST_CASE("rx_silent", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxSilentMode(); @@ -309,7 +309,7 @@ TEST_CASE("rx_silent", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_discardpolicy", "[.detectorintegration][.rx]") { +TEST_CASE("rx_discardpolicy", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxFrameDiscardPolicy(); @@ -338,7 +338,7 @@ TEST_CASE("rx_discardpolicy", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_padding", "[.detectorintegration][.rx]") { +TEST_CASE("rx_padding", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getPartialFramesPadding(); @@ -362,7 +362,7 @@ TEST_CASE("rx_padding", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_udpsocksize", "[.detectorintegration][.rx]") { +TEST_CASE("rx_udpsocksize", "[.detectorintegration]") { Detector det; Caller caller(&det); int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash( @@ -382,7 +382,7 @@ TEST_CASE("rx_udpsocksize", "[.detectorintegration][.rx]") { det.setRxUDPSocketBufferSize(prev_val); } -TEST_CASE("rx_realudpsocksize", "[.detectorintegration][.rx]") { +TEST_CASE("rx_realudpsocksize", "[.detectorintegration]") { Detector det; Caller caller(&det); uint64_t val = 0; @@ -401,7 +401,7 @@ TEST_CASE("rx_realudpsocksize", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_lock", "[.detectorintegration][.rx]") { +TEST_CASE("rx_lock", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxLock(); @@ -425,7 +425,7 @@ TEST_CASE("rx_lock", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_lastclient", "[.detectorintegration][.rx]") { +TEST_CASE("rx_lastclient", "[.detectorintegration]") { Detector det; Caller caller(&det); std::ostringstream oss; @@ -435,14 +435,14 @@ TEST_CASE("rx_lastclient", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_threads", "[.detectorintegration][.rx]") { +TEST_CASE("rx_threads", "[.detectorintegration]") { Detector det; Caller caller(&det); std::ostringstream oss; REQUIRE_NOTHROW(caller.call("rx_threads", {}, -1, GET, oss)); } -TEST_CASE("rx_arping", "[.detectorintegration][.rx]") { +TEST_CASE("rx_arping", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxArping(); @@ -1049,7 +1049,7 @@ TEST_CASE("foverwrite", "[.detectorintegration]") { } } -TEST_CASE("rx_framesperfile", "[.detectorintegration][.rx]") { +TEST_CASE("rx_framesperfile", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getFramesPerFile(); @@ -1080,7 +1080,7 @@ TEST_CASE("rx_framesperfile", "[.detectorintegration][.rx]") { /* ZMQ Streaming Parameters (Receiver<->Client) */ -TEST_CASE("rx_zmqstream", "[.detectorintegration][.rx]") { +TEST_CASE("rx_zmqstream", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxZmqDataStream(); @@ -1106,7 +1106,7 @@ TEST_CASE("rx_zmqstream", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_zmqfreq", "[.detectorintegration][.rx]") { +TEST_CASE("rx_zmqfreq", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxZmqFrequency(); @@ -1130,7 +1130,7 @@ TEST_CASE("rx_zmqfreq", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_zmqstartfnum", "[.detectorintegration][.rx]") { +TEST_CASE("rx_zmqstartfnum", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getRxZmqStartingFrame(); @@ -1154,7 +1154,7 @@ TEST_CASE("rx_zmqstartfnum", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_zmqport", "[.detectorintegration][.rx]") { +TEST_CASE("rx_zmqport", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val_zmqport = det.getRxZmqPort(); @@ -1232,7 +1232,7 @@ TEST_CASE("rx_zmqhwm", "[.detectorintegration]") { /* CTB Specific */ -TEST_CASE("rx_dbitlist", "[.detectorintegration][.rx]") { +TEST_CASE("rx_dbitlist", "[.detectorintegration]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1262,7 +1262,7 @@ TEST_CASE("rx_dbitlist", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_dbitoffset", "[.detectorintegration][.rx]") { +TEST_CASE("rx_dbitoffset", "[.detectorintegration]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1297,7 +1297,7 @@ TEST_CASE("rx_dbitoffset", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_dbitreorder", "[.detectorintegration][.rx]") { +TEST_CASE("rx_dbitreorder", "[.detectorintegration]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -1328,7 +1328,7 @@ TEST_CASE("rx_dbitreorder", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_jsonaddheader", "[.detectorintegration][.rx]") { +TEST_CASE("rx_jsonaddheader", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getAdditionalJsonHeader(); @@ -1354,7 +1354,7 @@ TEST_CASE("rx_jsonaddheader", "[.detectorintegration][.rx]") { } } -TEST_CASE("rx_jsonpara", "[.detectorintegration][.rx]") { +TEST_CASE("rx_jsonpara", "[.detectorintegration]") { Detector det; Caller caller(&det); auto prev_val = det.getAdditionalJsonHeader(); diff --git a/slsDetectorSoftware/tests/Caller/test-Caller.cpp b/slsDetectorSoftware/tests/Caller/test-Caller.cpp index 93c88713e..013428666 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller.cpp @@ -520,7 +520,7 @@ TEST_CASE("trimval", "[.detectorintegration]") { } } -TEST_CASE("trimen", "[.detectorintegration][.this]") { +TEST_CASE("trimen", "[.detectorintegration]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -840,7 +840,7 @@ TEST_CASE("triggers", "[.detectorintegration]") { det.setNumberOfTriggers(prev_val); } -TEST_CASE("exptime", "[.detectorintegration][.time]") { +TEST_CASE("exptime", "[.detectorintegration]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -3293,7 +3293,7 @@ TEST_CASE("update", "[.detectorintegration]") { } } -TEST_CASE("reg", "[.detectorintegration][.definecmds]") { +TEST_CASE("reg", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -3352,7 +3352,7 @@ TEST_CASE("adcreg", "[.detectorintegration]") { } } -TEST_CASE("setbit", "[.detectorintegration][.definecmds]") { +TEST_CASE("setbit", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -3382,7 +3382,7 @@ TEST_CASE("setbit", "[.detectorintegration][.definecmds]") { } } -TEST_CASE("clearbit", "[.detectorintegration][.definecmds]") { +TEST_CASE("clearbit", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); @@ -3412,7 +3412,7 @@ TEST_CASE("clearbit", "[.detectorintegration][.definecmds]") { } } -TEST_CASE("getbit", "[.detectorintegration][.definecmds]") { +TEST_CASE("getbit", "[.detectorintegration][reg]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); diff --git a/slsDetectorSoftware/tests/test-CtbConfig.cpp b/slsDetectorSoftware/tests/test-CtbConfig.cpp index e5ef153e0..5aaffeb3e 100644 --- a/slsDetectorSoftware/tests/test-CtbConfig.cpp +++ b/slsDetectorSoftware/tests/test-CtbConfig.cpp @@ -98,7 +98,7 @@ TEST_CASE("Move CtbConfig ") { REQUIRE(c2.getDacName(3) == "yetanothername"); } -TEST_CASE("Add or modify a register name", "[.reg]") { +TEST_CASE("Add or modify a register name", "[reg]") { CtbConfig c; auto addr = RegisterAddress(100); auto addr1 = RegisterAddress(300); @@ -123,7 +123,7 @@ TEST_CASE("Add or modify a register name", "[.reg]") { REQUIRE_THROWS(c.getRegisterName(addr1)); } -TEST_CASE("Add a register list", "[.reg]") { +TEST_CASE("Add a register list", "[reg]") { CtbConfig c; REQUIRE(c.getRegisterNamesCount() == 0); @@ -153,7 +153,7 @@ TEST_CASE("Add a register list", "[.reg]") { REQUIRE(c.getRegisterNames().size() == 0); } -TEST_CASE("Finding a regiser name or address", "[.reg]") { +TEST_CASE("Finding a regiser name or address", "[reg]") { CtbConfig c; RegisterAddress addr1(0x100); RegisterAddress addr2(0x200); @@ -174,7 +174,7 @@ TEST_CASE("Finding a regiser name or address", "[.reg]") { REQUIRE(c.getRegisterAddress("reg3") == addr3); } -TEST_CASE("Add or modify a bit name", "[.reg]") { +TEST_CASE("Add or modify a bit name", "[reg]") { CtbConfig c; RegisterAddress addr(0x100); BitAddress pos(addr, 2); @@ -204,7 +204,7 @@ TEST_CASE("Add or modify a bit name", "[.reg]") { REQUIRE_THROWS(c.getBitName(pos1)); } -TEST_CASE("Add a bit list", "[.reg]") { +TEST_CASE("Add a bit list", "[reg]") { CtbConfig c; REQUIRE(c.getBitNamesCount() == 0); @@ -238,7 +238,7 @@ TEST_CASE("Add a bit list", "[.reg]") { REQUIRE(c.getBitNames().size() == 0); } -TEST_CASE("Finding a bit value", "[.reg]") { +TEST_CASE("Finding a bit value", "[reg]") { CtbConfig c; RegisterAddress addr(0x100); BitAddress pos(addr, 2); diff --git a/slsDetectorSoftware/tests/test-slsDetector.cpp b/slsDetectorSoftware/tests/test-slsDetector.cpp deleted file mode 100644 index 966bb721b..000000000 --- a/slsDetectorSoftware/tests/test-slsDetector.cpp +++ /dev/null @@ -1,256 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-other -// Copyright (C) 2021 Contributors to the SLS Detector Package - -// #include "catch.hpp" -// #include "sls/container_utils.h" -// #include "slsDetector.h" -// #include "sls/sls_detector_defs.h" -// #include "sls/string_utils.h" -// #include -// #include - -// TEST_CASE("Set and get trimen", "[detector]") { -// // Free shared memory to be sure that we start in a clean state -// slsDetector::freeSharedMemory(20, 20); - -// // Create a detector and check that the type is set correctly -// slsDetector d(slsDetectorDefs::detectorType::EIGER, 20, 20); -// CHECK(d.getDetectorTypeAsEnum() == slsDetectorDefs::detectorType::EIGER); - -// // At the beginning there should be no trimen set -// auto res = d.getTrimEn(); -// CHECK(res.empty()); - -// std::vector energies{5200, 6400, 8500, 9900, 12000}; -// d.setTrimEn(energies); -// auto res2 = d.getTrimEn(); - -// // Check that the size and every element matches what we set -// CHECK(res2.size() == energies.size()); -// for (size_t i = 0; i != res2.size(); ++i) -// CHECK(res2[i] == energies[i]); - -// // Setting trimen with too many vales throws an exception and keeps the -// // old values -// std::vector too_many(150, 1000); -// CHECK_THROWS(d.setTrimEn(too_many)); -// auto res3 = d.getTrimEn(); -// CHECK(res3.size() == energies.size()); -// for (size_t i = 0; i != res3.size(); ++i) -// CHECK(res3[i] == energies[i]); - -// // Setting trimen without arguments resets to zero -// d.setTrimEn(); -// CHECK(d.getTrimEn().empty()); - -// // Clean up before next test -// d.freeSharedMemory(); -// } - -// TEST_CASE("Set additional JSON header", "[detector]") { -// slsDetector::freeSharedMemory(20, 20); -// slsDetector d(slsDetectorDefs::detectorType::EIGER, 20, 20); -// auto header = d.getAdditionalJsonHeader(); -// CHECK(header.empty()); - -// // The header set is not validated -// d.setAdditionalJsonHeader("any header"); -// header = d.getAdditionalJsonHeader(); -// CHECK(header == "any header"); - -// // make sure reset works -// d.setAdditionalJsonHeader(""); -// CHECK(d.getAdditionalJsonHeader().empty()); - -// // Setting and getting one parameter -// d.setAdditionalJsonParameter("exptime", "5"); -// CHECK(d.getAdditionalJsonParameter("exptime") == "5"); -// CHECK(d.getAdditionalJsonHeader() == "\"exptime\":5"); - -// // Making sure setting another paramer does not mess up -// // the first -// d.setAdditionalJsonParameter("gain", "low"); -// CHECK(d.getAdditionalJsonParameter("exptime") == "5"); -// CHECK(d.getAdditionalJsonParameter("gain") == "low"); -// CHECK(d.getAdditionalJsonHeader() == "\"exptime\":5,\"gain\":\"low\""); - -// // Change a value -// d.setAdditionalJsonParameter("exptime", "90"); -// CHECK(d.getAdditionalJsonParameter("exptime") == "90"); -// CHECK(d.getAdditionalJsonHeader() == "\"exptime\":90,\"gain\":\"low\""); - -// // Ask for a key that does not exists -// // TODO!(Erik) Is an empty string the right return or should we throw -// CHECK(d.getAdditionalJsonParameter("somerandomkey").empty()); - -// // Throws if value or key is empty -// CHECK_THROWS(d.setAdditionalJsonParameter("somekey", "")); -// CHECK_THROWS(d.setAdditionalJsonParameter("", "parameter")); -// CHECK_THROWS(d.setAdditionalJsonParameter("", "")); - -// // Throws if key or value has illegal char -// CHECK_THROWS(d.setAdditionalJsonParameter("mykey,", "5")); -// CHECK_THROWS(d.setAdditionalJsonParameter("some:key", "9")); -// CHECK_THROWS(d.setAdditionalJsonParameter("some\"key", "1")); -// CHECK_THROWS(d.setAdditionalJsonParameter("key", "value:")); -// CHECK_THROWS(d.setAdditionalJsonParameter("key", "va,lue")); -// CHECK_THROWS(d.setAdditionalJsonParameter("key", "va\"l\"ue")); - -// d.freeSharedMemory(); -// } - -// TEST_CASE("Set ROI", "[detector]") { -// using ROI = slsDetectorDefs::ROI; - -// slsDetector::freeSharedMemory(20,20); -// slsDetector d(slsDetectorDefs::detectorType::EIGER, 20, 20); - -// int n{0}; -// d.getROI(n); -// CHECK(n == 0); -// CHECK(d.getNRoi() == 0); - -// // set one ROI -// ROI r; -// r.xmin = 5; -// r.xmax = 100; -// r.ymin = 10; -// r.ymax = 300; -// d.setROI(1, &r); - -// auto res2 = d.getROI(n); -// CHECK(n == 1); -// CHECK(d.getNRoi() == 1); - -// CHECK(res2->xmin == 5); -// CHECK(res2->xmax == 100); -// CHECK(res2->ymin == 10); -// CHECK(res2->ymax == 300); - -// d.freeSharedMemory(); -// } - -// TEST_CASE("Set multiple ROIs", "[detector]") { -// using ROI = slsDetectorDefs::ROI; - -// slsDetector::freeSharedMemory(20, 20); -// slsDetector d(slsDetectorDefs::detectorType::EIGER, 20, 20); - -// // set one ROI -// constexpr int n = 3; -// ROI r[n]; -// r[0].xmin = 500; -// r[0].xmax = 60000; -// r[0].ymin = 100; -// r[0].ymax = 800; - -// r[1].xmin = 2; -// r[1].xmax = 100; -// r[1].ymin = 1; -// r[1].ymax = 300; - -// r[2].xmin = 200; -// r[2].xmax = 300; -// r[2].ymin = 15; -// r[2].ymax = 307; -// d.setROI(n, r); - -// int n_roi{0}; -// auto res = d.getROI(n_roi); -// CHECK(n_roi == n); -// CHECK(d.getNRoi() == n); - -// CHECK(res[0].xmin == 2); -// CHECK(res[0].xmax == 100); -// CHECK(res[0].ymin == 1); -// CHECK(res[0].ymax == 300); - -// CHECK(res[1].xmin == 200); -// CHECK(res[1].xmax == 300); -// CHECK(res[1].ymin == 15); -// CHECK(res[1].ymax == 307); - -// CHECK(res[2].xmin == 500); -// CHECK(res[2].xmax == 60000); -// CHECK(res[2].ymin == 100); -// CHECK(res[2].ymax == 800); - -// d.freeSharedMemory(); -// } - -// TEST_CASE("Padding and discard policy", "[detector][new]"){ -// slsDetector::freeSharedMemory(20, 20); -// slsDetector d(slsDetectorDefs::detectorType::EIGER, 20, 20); - -// // -// d.setPartialFramesPadding(false); -// CHECK(d.getPartialFramesPadding() == false); -// d.setPartialFramesPadding(true); -// CHECK(d.getPartialFramesPadding() == true); - -// d.freeSharedMemory(); - -// } - -// TEST_CASE("create detParamets struct", "[detector][new]"){ -// detParameters par; -// CHECK(sizeof(par) == 32); -// CHECK(par.nChanX == 0); -// CHECK(par.nChanY == 0); -// CHECK(par.nChipX == 0); -// CHECK(par.nChipY == 0); -// CHECK(par.nDacs == 0); -// CHECK(par.dynamicRange == 0); -// CHECK(par.nGappixelsX == 0); -// CHECK(par.nGappixelsY == 0); - -// detParameters par2{slsDetectorDefs::detectorType::EIGER}; -// CHECK(sizeof(par2) == 32); -// CHECK(par2.nChanX == 256); -// CHECK(par2.nChanY == 256); -// CHECK(par2.nChipX == 4); -// CHECK(par2.nChipY == 1); -// CHECK(par2.nDacs == 16); -// CHECK(par2.dynamicRange == 16); -// CHECK(par2.nGappixelsX == 6); -// CHECK(par2.nGappixelsY == 1); -// } - -// TEST_CASE("ctb digital offset and list", "[detector][ctb]"){ -// slsDetector::freeSharedMemory(20, 20); -// slsDetector d(slsDetectorDefs::detectorType::CHIPTESTBOARD, 20, 20); - -// // dbit offset -// CHECK(d.getReceiverDbitOffset() == 0); -// CHECK(d.setReceiverDbitOffset(-1) == 0); -// CHECK(d.setReceiverDbitOffset(0) == 0); -// CHECK(d.setReceiverDbitOffset(5) == 5); -// CHECK(d.getReceiverDbitOffset() == 5); - -// // dbit list -// std::vector list = d.getReceiverDbitList(); -// CHECK(list.empty()); - -// for (int i = 0; i < 10; ++i) -// list.push_back(i); -// d.setReceiverDbitList(list); - -// CHECK(d.getReceiverDbitList().size() == 10); - -// list.push_back(64); -// CHECK_THROWS_AS(d.setReceiverDbitList(list), RuntimeError); -// CHECK_THROWS_WITH(d.setReceiverDbitList(list), -// Catch::Matchers::Contains("be between 0 and 63")); - -// list.clear(); -// for (int i = 0; i < 65; ++i) -// list.push_back(i); -// CHECK(list.size() == 65); -// CHECK_THROWS_WITH(d.setReceiverDbitList(list), -// Catch::Matchers::Contains("be greater than 64")); - -// list.clear(); -// d.setReceiverDbitList(list); -// CHECK(d.getReceiverDbitList().empty()); - -// } \ No newline at end of file diff --git a/slsReceiverSoftware/tests/test-Apps.cpp b/slsReceiverSoftware/tests/test-Apps.cpp index 98d186718..84b4aba9e 100644 --- a/slsReceiverSoftware/tests/test-Apps.cpp +++ b/slsReceiverSoftware/tests/test-Apps.cpp @@ -138,44 +138,23 @@ TEST_CASE("Parse version and help", "[detector]") { } } -// TODO: fails on gitea CI due to uid issue, fix later -TEST_CASE("Parse port and uid", "[.failsongitea][detector]") { - uid_t uid = getuid(); - std::string uidStr = std::to_string(uid); - uid_t invalidUid = uid + 1000; - std::string invalidUidStr = std::to_string(invalidUid); - +TEST_CASE("Parse port", "[detector]") { for (auto app : {AppType::SingleReceiver, AppType::MultiReceiver, AppType::FrameSynchronizer}) { CommandLineOptions s(app); - // TODO! This test fails on gitea CI probably because the user can set - // the uid commenting it out for now. Revisit later. REQUIRE_THROWS( - // s.parse({"", "-p", "1234", "-u", invalidUidStr})); // invalid uid - REQUIRE_THROWS(s.parse({"", "-p", "500"})); // invalid port - auto opts = s.parse({"", "-p", "1234", "-u", uidStr}); - std::visit( - [&](const auto &o) { - REQUIRE(o.port == 1234); - REQUIRE(o.userid == uid); - }, - opts); + auto opts = s.parse({"", "-p", "1234"}); + std::visit([&](const auto &o) { REQUIRE(o.port == 1234); }, opts); opts = s.parse({"", "-p", "5678"}); - std::visit( - [](const auto &o) { - REQUIRE(o.port == 5678); - REQUIRE(o.userid == static_cast(-1)); // default - }, - opts); + std::visit([](const auto &o) { REQUIRE(o.port == 5678); }, opts); opts = s.parse({}); std::visit( [](const auto &o) { - REQUIRE(o.port == 1954); // default - REQUIRE(o.userid == static_cast(-1)); // default + REQUIRE(o.port == 1954); // default }, opts); } diff --git a/slsSupportLib/tests/test-bit_utils.cpp b/slsSupportLib/tests/test-bit_utils.cpp index ac9ddad8a..63af8dac2 100644 --- a/slsSupportLib/tests/test-bit_utils.cpp +++ b/slsSupportLib/tests/test-bit_utils.cpp @@ -121,8 +121,8 @@ TEST_CASE("Convert BitAddress using classes", "[support]") { } } -TEST_CASE("Output operator gives same result as string", - "[support]") { +TEST_CASE("RegisterAddress Output operator gives same result as string", + "[support][reg]") { { RegisterAddress addr{0x3456af}; std::ostringstream os; diff --git a/slsSupportLib/tests/test-sls_detector_defs.cpp b/slsSupportLib/tests/test-sls_detector_defs.cpp index b7f2421c5..9c8deb46c 100644 --- a/slsSupportLib/tests/test-sls_detector_defs.cpp +++ b/slsSupportLib/tests/test-sls_detector_defs.cpp @@ -7,7 +7,7 @@ namespace sls { using dt = slsDetectorDefs::detectorType; -TEST_CASE("sls_detector_module default construction", "[support][new]") { +TEST_CASE("sls_detector_module default construction", "[support]") { sls_detector_module m; CHECK(m.serialnumber == 0); CHECK(m.nchan == 0);