CI(pico-sensor): added dummy test that always passes (to test if test run works)

This commit is contained in:
SylvanArnold
2025-06-03 22:11:04 +02:00
parent adca10d0fb
commit 1d05424721
3 changed files with 17 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ pico-sensor-test:
- cmake --preset Test
- cmake --build --preset app-test
- cd build/Test
- ctest -T test --output-on-failure --output-junit test-results.xml -R ^Led$
- ctest -T test --output-on-failure --output-junit test-results.xml -R ^DUMMY$
artifacts:
paths:
- pico-sensor/build/Test/test-results.xml

View File

@@ -52,8 +52,13 @@ add_test(
COMMAND ${JRUN_CTEST_COMMAND} --args "dns" ${TEST_EXECUTABLE}
)
add_test(
NAME DUMMY
COMMAND ${JRUN_CTEST_COMMAND} --args "dummy" ${TEST_EXECUTABLE}
)
set_tests_properties(
Led Sensor DNS
PROPERTIES
TIMEOUT 15
TIMEOUT 30
)

View File

@@ -22,6 +22,11 @@ static void TestArgFailed(void) {
TEST_ASSERT_MESSAGE(false, "wrong test_arg value");
}
static void TestDummy(void) {
TEST_ASSERT_TRUE_MESSAGE(true, "Dummy test always passes");
}
void Tests_Run(void) {
int nofFailures;
uint32_t test_arg = -1;
@@ -40,7 +45,11 @@ void Tests_Run(void) {
//RUN_TEST(TestSensor_Both);
} else if (McuUtility_strcmp(buf, "dns")==0) {
RUN_TEST(TestDnsResolver_Test);
} else {
}
else if (McuUtility_strcmp(buf, "dummy")==0) {
RUN_TEST(TestDummy);
}
else {
RUN_TEST(TestArgFailed);
}
} else {