Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"postCreateCommand": "git submodule update --init --recursive",
"customizations": {
"vscode": {
"extensions": ["ms-vscode.vscode-serial-monitor"]
"extensions": [
"ms-vscode.vscode-serial-monitor",
"alexkrechik.cucumberautocomplete"
]
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
- run: mv hal_st-*-Linux/* install/
- run: ls install/bin
- run: install/bin/integration_test.flasher tcp://localhost:1234/target/echo/programmer integration_test.tested.bin
- run: install/bin/integration_test.runner run --feature integration_test/runner/features --report console --target tcp://localhost:1234/target/echo/programmer
- run: install/bin/integration_test.runner --format pretty --target tcp://localhost:1234/target/echo/programmer -- integration_test/runner/features
- if: always()
run: docker logs flex_container
- name: Remove flex container
Expand Down
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"cucumberautocomplete.steps": [
"integration_test/runner/*.cpp"
],
"cucumberautocomplete.stepsInvariants": true,
"cucumberautocomplete.gherkinDefinitionPart": "(GIVEN|WHEN|THEN|STEP)\\(",
"cucumberautocomplete.customParameters": [
{
"parameter": "R\"(",
"value": "\""
},
{
"parameter": ")\"",
"value": "\""
},
{
"parameter": "{PinState}",
"value": "(high|low)"
}
]
}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ if (HALST_STANDALONE)
FetchContent_Declare(
cucumber-cpp-runner
GIT_REPOSITORY https://github.com/philips-software/amp-cucumber-cpp-runner.git
GIT_TAG 1c7fcde3dd140ce3f9c7327e66e2a73344625328 # unreleased
GIT_TAG 7aecccc930d650154ca877b1edaa0760f4ead9b7 # unreleased
)

set(CCR_FETCH_DEPS On)
FetchContent_MakeAvailable(cucumber-cpp-runner)
endif()
endif()
Expand Down
28 changes: 14 additions & 14 deletions integration_test/runner/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber_cpp/library/Hooks.hpp"
#include "cucumber_cpp/CucumberCpp.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "generated/echo/TracingTesting.pb.hpp"
#include "hal/generic/TimerServiceGeneric.hpp"
Expand All @@ -24,9 +24,9 @@ HOOK_BEFORE_ALL()
services::GlobalTracer().Trace() << "Opening ECHO connection to: " << target;

context.SetShared(application::OpenEcho(target, context.Get<services::ConnectionFactoryWithNameResolver>()));
//auto tracingEcho = application::OpenTracingEcho(target, context.Get<services::ConnectionFactoryWithNameResolver>(), services::GlobalTracer());
//context.SetShared(tracingEcho.first);
//context.SetShared(tracingEcho.second);
// auto tracingEcho = application::OpenTracingEcho(target, context.Get<services::ConnectionFactoryWithNameResolver>(), services::GlobalTracer());
// context.SetShared(tracingEcho.first);
// context.SetShared(tracingEcho.second);

services::GlobalTracer().Trace() << "Established ECHO connection";
}
Expand All @@ -41,16 +41,16 @@ HOOK_BEFORE_ALL()
context.Emplace<application::TesterObserver>(context.Get<services::Echo>());
context.Emplace<application::TestedObserver>(context.Get<services::Echo>());

//context.Emplace<testing::TesterTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::TestedTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::TesterObserverTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::TestedObserverTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::GpioTesterTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::GpioTestedTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::GpioObserverTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::UartTesterTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::UartTestedTracer>(context.Get<services::TracingEchoOnStreams>());
//context.Emplace<testing::UartObserverTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::TesterTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::TestedTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::TesterObserverTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::TestedObserverTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::GpioTesterTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::GpioTestedTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::GpioObserverTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::UartTesterTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::UartTestedTracer>(context.Get<services::TracingEchoOnStreams>());
// context.Emplace<testing::UartObserverTracer>(context.Get<services::TracingEchoOnStreams>());
}

HOOK_BEFORE_SCENARIO()
Expand Down
15 changes: 10 additions & 5 deletions integration_test/runner/StepsGpio.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber_cpp/library/Steps.hpp"
#include "cucumber_cpp/CucumberCpp.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "infra/timer/Waiting.hpp"
#include "integration_test/logic/Tested.hpp"
Expand Down Expand Up @@ -40,6 +40,11 @@ namespace
bool testerGpio = false;
bool testedGpio = false;
};

PARAMETER(std::string, "PinState", "(high|low)")
{
return group.value.value();
}
}

STEP("gpio peripherals are enabled")
Expand Down Expand Up @@ -77,7 +82,7 @@ STEP("gpio peripherals are enabled")
context.Emplace<testing::GpioTestedProxy>(context.Get<services::Echo>());
}

STEP("the tester sets its output pin (high|low)", (std::string state))
STEP("the tester sets its output pin {PinState}", (std::string state))
{
context.EmplaceAt<bool>("state", ConvertPinState(state));

Expand All @@ -91,7 +96,7 @@ STEP("the tester sets its output pin (high|low)", (std::string state))
}));
}

STEP("the tester sees a (high|low) value", (std::string state))
STEP("the tester sees a {PinState} value", (std::string state))
{
context.EmplaceAt<bool>("state", ConvertPinState(state));

Expand All @@ -101,7 +106,7 @@ STEP("the tester sees a (high|low) value", (std::string state))
}));
}

STEP("the tested sets its output pin (high|low)", (std::string state))
STEP("the tested sets its output pin {PinState}", (std::string state))
{
context.EmplaceAt<bool>("state", ConvertPinState(state));

Expand All @@ -115,7 +120,7 @@ STEP("the tested sets its output pin (high|low)", (std::string state))
}));
}

STEP("the tested sees a (high|low) value", (std::string state))
STEP("the tested sees a {PinState} value", (std::string state))
{
context.EmplaceAt<bool>("state", ConvertPinState(state));

Expand Down
2 changes: 1 addition & 1 deletion integration_test/runner/StepsUart.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "cucumber_cpp/library/Steps.hpp"
#include "cucumber_cpp/CucumberCpp.hpp"
#include "generated/echo/Testing.pb.hpp"
#include "infra/timer/Waiting.hpp"
#include "integration_test/logic/Tested.hpp"
Expand Down
Loading