Skip to content

Commit fd62941

Browse files
SorinOlarikr-t
authored andcommitted
tests(ocre): add OCRE_TEST_OTHER_CONTEXT_PATH build config
Signed-off-by: SorinO <sorin.olari2@gmail.com>
1 parent 4eec285 commit fd62941

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

tests/system/ocre.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void test_ocre_create_provided_context(void)
3636
{
3737
/* Creating the other context should work */
3838

39-
struct ocre_context *other_ctx = ocre_create_context("othercontext");
39+
struct ocre_context *other_ctx = ocre_create_context(OCRE_TEST_OTHER_CONTEXT_PATH);
4040
TEST_ASSERT_NOT_NULL(other_ctx);
4141

4242
/* We can also destroy the other context */
@@ -53,7 +53,7 @@ void test_ocre_create_two_contexts(void)
5353

5454
/* Creating the other context should work */
5555

56-
struct ocre_context *other_ctx = ocre_create_context("othercontext");
56+
struct ocre_context *other_ctx = ocre_create_context(OCRE_TEST_OTHER_CONTEXT_PATH);
5757
TEST_ASSERT_NOT_NULL(other_ctx);
5858

5959
/* We can also destroy the main_ctx */

tests/system/posix/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ foreach(test ${OCRE_TESTS})
4646
../${test}.c
4747
)
4848

49+
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/../ocre.c PROPERTIES COMPILE_FLAGS
50+
-DOCRE_TEST_OTHER_CONTEXT_PATH=\\"./othercontext\\"
51+
)
52+
4953
target_link_libraries(test_${test}
5054
OcreCore
5155
Unity

tests/system/zephyr/ocre/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ target_sources(app
2626
../../ocre.c
2727
)
2828

29+
set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/../../ocre.c PROPERTIES COMPILE_FLAGS
30+
-DOCRE_TEST_OTHER_CONTEXT_PATH=\\"/lfs/other\\"
31+
)
32+
2933
target_link_libraries(app
3034
PUBLIC
3135
OcreCore

0 commit comments

Comments
 (0)