Merge pull request 'Init ACS Test files' (#249) from mueller/acs-test-init into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
Reviewed-on: #249 Reviewed-by: Jakob.Meier <meierj@irs.uni-stuttgart.de>
This commit is contained in:
commit
cb8f0e61be
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -19,3 +19,6 @@
|
||||
[submodule "thirdparty/json"]
|
||||
path = thirdparty/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
[submodule "thirdparty/rapidcsv"]
|
||||
path = thirdparty/rapidcsv
|
||||
url = https://github.com/d99kris/rapidcsv.git
|
||||
|
@ -308,6 +308,8 @@ if(EIVE_ADD_JSON_LIB)
|
||||
add_subdirectory(${LIB_JSON_PATH})
|
||||
endif()
|
||||
|
||||
add_subdirectory(thirdparty/rapidcsv)
|
||||
|
||||
if(EIVE_ADD_LINUX_FILES)
|
||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||
add_subdirectory(${LINUX_PATH})
|
||||
@ -406,6 +408,7 @@ endif()
|
||||
target_link_libraries(${UNITTEST_NAME} PRIVATE
|
||||
Catch2
|
||||
${LIB_EIVE_MISSION}
|
||||
rapidcsv
|
||||
)
|
||||
|
||||
if(TGT_BSP MATCHES "arm/egse")
|
||||
|
@ -603,7 +603,7 @@
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689" name="eive-q7s-debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.enablement=null,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.image=null,org.eclipse.cdt.docker.launcher.containerbuild.property.connection=null" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" errorParsers="org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.GCCErrorParser" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689" name="eive-q7s-debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.enablement=null,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.connection=null,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.image=null" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<folderInfo id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689." name="/" resourcePath="">
|
||||
<toolChain id="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base.1439714522" name="Arm Cross GCC" superClass="ilg.gnuarmeclipse.managedbuild.cross.toolchain.base">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.1064018737" name="Architecture" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.architecture" value="ilg.gnuarmeclipse.managedbuild.cross.option.architecture.arm" valueType="enumerated"/>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="cmake-build-debug/eive-unittest"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="eive-obsw"/>
|
||||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168"/>
|
||||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.758550634"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/eive-obsw"/>
|
||||
</listAttribute>
|
||||
|
1
thirdparty/rapidcsv
vendored
Submodule
1
thirdparty/rapidcsv
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit d4e0bc1047ca3965653463dc63f6d230a043a060
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit c5862579348974882e23d39d0a6d9b2844159b99
|
||||
Subproject commit 6b7b07c3409fc24a8585c39e308156b3657c655e
|
@ -1,3 +1,4 @@
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
testThermalController.cpp
|
||||
testAcsController.cpp
|
||||
)
|
47
unittest/controller/testAcsController.cpp
Normal file
47
unittest/controller/testAcsController.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include <mission/controller/ThermalController.h>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "../testEnvironment.h"
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
#include "rapidcsv.h"
|
||||
|
||||
|
||||
TEST_CASE("ACS Controller", "[AcsController]") {
|
||||
|
||||
SECTION("SectionTest") {
|
||||
//acsCtrl.performOperation();
|
||||
CHECK(1 == 1);
|
||||
|
||||
try {
|
||||
{
|
||||
std::ifstream file("unittest/meineTestDaten.txt");
|
||||
if (file.good()) {
|
||||
std::string line;
|
||||
while(std::getline(file, line)) {
|
||||
std::cout << "ACS CTRL Test test file: " << line << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
rapidcsv::Document doc("unittest/meineTestDaten.txt");
|
||||
std::vector<int> col = doc.GetColumn<int>("test0");
|
||||
std::cout << "Read " << col.size() << " values: " << col[0] << ", " << col[1] << std::endl;
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
sif::warning << "CSV file test exception occured: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
REQUIRE(2 == 2);
|
||||
}
|
||||
|
||||
SECTION("SectionTest2") {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -42,4 +42,4 @@ TEST_CASE("Thermal Controller", "[ThermalController]") {
|
||||
componentTemperatures.commit();
|
||||
|
||||
QueueFactory::instance()->deleteMessageQueue(commandQueue);
|
||||
}
|
||||
}
|
||||
|
3
unittest/meineTestDaten.txt
Normal file
3
unittest/meineTestDaten.txt
Normal file
@ -0,0 +1,3 @@
|
||||
test0,test1,test2
|
||||
0,2,3
|
||||
4,5,6
|
Loading…
Reference in New Issue
Block a user