moved headers

This commit is contained in:
Erik Frojdh 2019-11-25 11:58:45 +01:00
parent eae1fb6609
commit 58050f72da
7 changed files with 86 additions and 2 deletions

View File

@ -3,9 +3,11 @@ find_package(Sphinx)
if (DOXYGEN_FOUND AND SPHINX_FOUND) if (DOXYGEN_FOUND AND SPHINX_FOUND)
message(${CMAKE_PROJECT_SORURCE_DIR}/slsDetectorSoftware/src)
# #Utility to generate command line documentation # Utility to generate command line documentation
add_executable(gendoc src/gendoc.cpp) add_executable(gendoc src/gendoc.cpp)
# This is a bit hacky, but better than exposing stuff?
target_include_directories(gendoc PRIVATE ${PROJECT_SOURCE_DIR}/slsDetectorSoftware/src)
target_link_libraries(gendoc PRIVATE target_link_libraries(gendoc PRIVATE
slsDetectorShared slsDetectorShared
) )

View File

@ -0,0 +1,82 @@
#include "CmdProxy.h"
#include "Detector.h"
#include "catch.hpp"
#include "sls_detector_defs.h"
#include <sstream>
#include "tests/globals.h"
using sls::CmdProxy;
using sls::Detector;
using test::GET;
using test::PUT;
/*
This file should contain receiver specific tests
*/
TEST_CASE("rx_missingpackets", "[.cmd]") {
// TODO! This only tests for no crash how can we test
// for correct values?
Detector det;
CmdProxy proxy(&det);
proxy.Call("rx_missingpackets", {}, -1, GET);
}
// TEST_CASE("burstmode", "[.cmd][.gotthard2]") {
// if (test::type == slsDetectorDefs::GOTTHARD2) {
// REQUIRE_NOTHROW(multiSlsDetectorClient("burstmode 0", PUT));
// REQUIRE_NOTHROW(multiSlsDetectorClient("burstmode 1", PUT));
// REQUIRE_NOTHROW(multiSlsDetectorClient("burstmode", GET));
// } else {
// REQUIRE_THROWS(multiSlsDetectorClient("burstmod", GET));
// }
// }
// TEST_CASE("vetoref", "[.cmd][.gotthard2]") {
// if (test::type == slsDetectorDefs::GOTTHARD2) {
// REQUIRE_THROWS(multiSlsDetectorClient("vetoref 3 0x3ff", PUT)); //
// invalid chip index REQUIRE_THROWS(multiSlsDetectorClient("vetoref 0
// 0xFFFF", PUT)); // invalid value
// REQUIRE_NOTHROW(multiSlsDetectorClient("vetoref 1 0x010", PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vetoref", GET));
// } else {
// REQUIRE_THROWS(multiSlsDetectorClient("vetoref 3 0x0", PUT));
// }
// }
// TEST_CASE("vetophoton", "[.cmd][.gotthard2]") {
// if (test::type == slsDetectorDefs::GOTTHARD2) {
// REQUIRE_THROWS(multiSlsDetectorClient("vetophoton 12 1 39950
// examples/gotthard2_veto_photon.txt", PUT)); // invalid chip index
// REQUIRE_THROWS(multiSlsDetectorClient("vetophoton -1 0 39950
// examples/gotthard2_veto_photon.txt", PUT)); // invalid photon number
// REQUIRE_NOTHROW(multiSlsDetectorClient("vetophoton -1 1 39950
// examples/gotthard2_veto_photon.txt", PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("vetophoton", GET));
// REQUIRE_NOTHROW(multiSlsDetectorClient("vetophoton -1", GET));
// } else {
// REQUIRE_THROWS(multiSlsDetectorClient("vetophoton -1", GET));
// }
// }
// TEST_CASE("inj_ch", "[.cmd][.gotthard2]") {
// if (test::type == slsDetectorDefs::GOTTHARD2) {
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("inj_ch 0 1", PUT,
// nullptr, oss)); REQUIRE(oss.str() == "inj_ch [0, 1]\n");
// }
// {
// std::ostringstream oss;
// REQUIRE_NOTHROW(multiSlsDetectorClient("inj_ch", GET, nullptr,
// oss)); REQUIRE(oss.str() == "inj_ch [0, 1]\n");
// }
// REQUIRE_THROWS(multiSlsDetectorClient("inj_ch -1 1", PUT));
// REQUIRE_THROWS(multiSlsDetectorClient("inj_ch 0 0", PUT));
// } else {
// REQUIRE_THROWS(multiSlsDetectorClient("inj_ch", GET));
// }
// }