mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
changed constructor
This commit is contained in:
53
integrationTests/CMakeLists.txt
Normal file
53
integrationTests/CMakeLists.txt
Normal file
@ -0,0 +1,53 @@
|
||||
MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||
|
||||
|
||||
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/catch
|
||||
)
|
||||
|
||||
|
||||
if(USE_TESTS)
|
||||
|
||||
set(TEST_SOURCES
|
||||
src/test-slsDetector.cpp
|
||||
# src/test.cpp
|
||||
)
|
||||
add_executable(a ${TEST_SOURCES})
|
||||
target_link_libraries(a
|
||||
slsDetectorShared
|
||||
slsSupportLib
|
||||
pthread
|
||||
rt
|
||||
)
|
||||
set_target_properties(a PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
#option(USE_TESTS "Determines whether to build tests." OFF)
|
||||
# if(USE_TESTS)
|
||||
# # Prepare "Catch" library for other executables
|
||||
# set(CATCH_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/catch)
|
||||
# add_library(Catch INTERFACE)
|
||||
# target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
|
||||
|
||||
# # Make test executable
|
||||
# add_executable(tests ${BASE_TEST_SOURCES})
|
||||
# target_link_libraries(tests Catch)
|
||||
|
||||
# set_target_properties(tests PROPERTIES
|
||||
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
# )
|
||||
|
||||
# #enable_testing()
|
||||
# #add_test(NAME CommandLineClient COMMAND tests)
|
||||
|
||||
# endif()
|
||||
|
||||
|
||||
# install(TARGETS sls_client DESTINATION bin)
|
||||
|
11
integrationTests/src/test-multiDetector.cpp
Normal file
11
integrationTests/src/test-multiDetector.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
// #include "catch.hpp"
|
||||
// #include "multiSlsDetector.h"
|
||||
|
||||
// #include <iostream>
|
||||
// TEST_CASE("Initialize a detector") {
|
||||
// multiSlsDetector det(0, true, true);
|
||||
// std::cout << "Size: " << det.getNumberOfDetectors() << std::endl;
|
||||
// std::cout << "Hostname: " << det.getHostname() << std::endl;
|
||||
// REQUIRE(false);
|
||||
|
||||
// }
|
30
integrationTests/src/test-slsDetector.cpp
Normal file
30
integrationTests/src/test-slsDetector.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "logger.h"
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "slsDetector.h"
|
||||
#include "sls_detector_defs.h"
|
||||
#define VERBOSE
|
||||
|
||||
int main(){
|
||||
const std::string hostname = "beb083";
|
||||
// const std::string hostname = "129.129.202.194";
|
||||
auto type = slsDetector::getDetectorTypeAsEnum(hostname);
|
||||
auto d = slsDetector(type);
|
||||
d.setHostname(hostname.c_str());
|
||||
// auto d = slsDetector();
|
||||
|
||||
std::cout << "type: " << d.getDetectorTypeAsString() << '\n';
|
||||
std::cout << "hostname: " << d.getHostname() << '\n';
|
||||
std::cout << "threshold: " << d.getThresholdEnergy() << '\n';
|
||||
std::cout << "exptime: " << d.setTimer(slsDetectorDefs::timerIndex::ACQUISITION_TIME) << '\n';
|
||||
|
||||
|
||||
// auto d2 = slsDetector(type, 0, 1);
|
||||
// d2.setHostname("beb098");.
|
||||
// auto d2 = slsDetector();
|
||||
// std::cout << "hn: " << d2.getHostname() << '\n';
|
||||
return 0;
|
||||
}
|
3
integrationTests/src/test.cpp
Normal file
3
integrationTests/src/test.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
// tests-main.cpp
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
Reference in New Issue
Block a user