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 --preset Test
- cmake --build --preset app-test - cmake --build --preset app-test
- cd build/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: artifacts:
paths: paths:
- pico-sensor/build/Test/test-results.xml - pico-sensor/build/Test/test-results.xml

View File

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

View File

@@ -22,6 +22,11 @@ static void TestArgFailed(void) {
TEST_ASSERT_MESSAGE(false, "wrong test_arg value"); 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) { void Tests_Run(void) {
int nofFailures; int nofFailures;
uint32_t test_arg = -1; uint32_t test_arg = -1;
@@ -40,7 +45,11 @@ void Tests_Run(void) {
//RUN_TEST(TestSensor_Both); //RUN_TEST(TestSensor_Both);
} else if (McuUtility_strcmp(buf, "dns")==0) { } else if (McuUtility_strcmp(buf, "dns")==0) {
RUN_TEST(TestDnsResolver_Test); RUN_TEST(TestDnsResolver_Test);
} else { }
else if (McuUtility_strcmp(buf, "dummy")==0) {
RUN_TEST(TestDummy);
}
else {
RUN_TEST(TestArgFailed); RUN_TEST(TestArgFailed);
} }
} else { } else {