rudimentary clion support

This commit is contained in:
Robin Müller 2022-05-12 18:59:39 +02:00
parent e2d3158506
commit 7ab617accb
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
9 changed files with 51 additions and 23 deletions

8
.gitignore vendored
View File

@ -1,6 +1,14 @@
# PyCharm and CLion
/.idea/*
!/.idea/runConfigurations
!/.idea/cmake.xml
!/.idea/codeStyles
# Eclipse
.cproject
.project
.settings
.metadata
/build*
/cmake-build*

View File

@ -0,0 +1,14 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<clangFormatSettings>
<option name="ENABLED" value="true" />
</clangFormatSettings>
<codeStyleSettings language="CMake">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="0" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="fsfw-tests_coverage" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-tests" TARGET_NAME="fsfw-tests_coverage" CONFIG_NAME="Debug Unittest" RUN_TARGET_PROJECT_NAME="fsfw-tests" RUN_TARGET_NAME="fsfw-tests">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

7
.run/fsfw.run.xml Normal file
View File

@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="fsfw" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="fsfw-tests" TARGET_NAME="fsfw" CONFIG_NAME="Debug Unittest" RUN_TARGET_PROJECT_NAME="fsfw-tests" RUN_TARGET_NAME="fsfw-tests">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -1,7 +1,8 @@
#include "CatchDefinitions.h"
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include "fsfw/serviceinterface.h"
StorageManagerIF* tglob::getIpcStoreHandle() {
if (ObjectManager::instance() != nullptr) {
@ -10,7 +11,7 @@ StorageManagerIF* tglob::getIpcStoreHandle() {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Global object manager uninitialized" << std::endl;
#else
sif::printError("Global object manager uninitialized\n\r");
FSFW_LOGE("Global object manager uninitialized\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
return nullptr;
}

View File

@ -6,24 +6,14 @@
#endif
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/storagemanager/StorageManagerIF.h"
/* Global instantiations normally done in main.cpp */
/* Initialize Data Pool */
#if FSFW_CPP_OSTREAM_ENABLED == 1
namespace sif {
/* Set up output streams */
ServiceInterfaceStream debug("DEBUG");
ServiceInterfaceStream info("INFO");
ServiceInterfaceStream error("ERROR");
ServiceInterfaceStream warning("WARNING");
} // namespace sif
#endif
int customSetup() {
// global setup
sif::initialize();
ObjectManager* objMan = ObjectManager::instance();
objMan->setObjectFactoryFunction(Factory::produceFrameworkObjects, nullptr);
objMan->initialize();

View File

@ -17,14 +17,14 @@
TEST_CASE("CFDP TLV LV", "[CfdpTlvLv]") {
using namespace cfdp;
int result = HasReturnvaluesIF::RETURN_OK;
std::array<uint8_t, 255> rawBuf;
std::array<uint8_t, 255> rawBuf{};
uint8_t* serPtr = rawBuf.data();
const uint8_t* deserPtr = rawBuf.data();
size_t deserSize = 0;
cfdp::EntityId sourceId = EntityId(cfdp::WidthInBytes::TWO_BYTES, 0x0ff0);
SECTION("TLV Serialization") {
std::array<uint8_t, 8> tlvRawBuf;
std::array<uint8_t, 8> tlvRawBuf{};
serPtr = tlvRawBuf.data();
result =
sourceId.serialize(&serPtr, &deserSize, tlvRawBuf.size(), SerializeIF::Endianness::NETWORK);

View File

@ -1,9 +1,9 @@
#include "PollingSequenceFactory.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
#include "fsfw/serviceinterface.h"
#include "tests/TestsConfig.h"
ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) {
@ -11,8 +11,8 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence)
uint32_t length = thisSequence->getPeriodMs();
/* Add polling sequence table here */
thisSequence->addSlot(objects::TEST_DEVICE, 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TEST_DEVICE, 0.3, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TEST_DEVICE, 0 * length, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::TEST_DEVICE, 0.3 * length, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::TEST_DEVICE, 0.45 * length, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::TEST_DEVICE, 0.6 * length, DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::TEST_DEVICE, 0.8 * length, DeviceHandlerIF::GET_READ);
@ -20,11 +20,7 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence)
if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) {
return HasReturnvaluesIF::RETURN_OK;
} else {
#if FSFW_CPP_OSTREAM_ENABLED
sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl;
#else
sif::printError("pst::pollingSequenceInitDefault: Sequence invalid!");
#endif
FSFW_LOGE("pst::pollingSequenceInitDefault: Sequence invalid!\n");
return HasReturnvaluesIF::RETURN_FAILED;
}
}