Skip to content

Commit

Permalink
Tests: Add testcase for CONFIG_THINGSET_TEXT_MODE=n
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjaeger committed May 1, 2024
1 parent d118db0 commit 0389f4a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/protocol/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ CONFIG_ZTEST_TC_UTIL_USER_OVERRIDE=y
#CONFIG_BUILD_OUTPUT_STRIP_PATHS=n

CONFIG_COVERAGE=y

# The txt mode test suite may be skipped
CONFIG_ZTEST_VERIFY_RUN_ALL=n
7 changes: 6 additions & 1 deletion tests/protocol/src/txt.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,16 @@ ZTEST(thingset_txt, test_import_record)
records[1].b = true;
}

static bool thingset_txt_predicate(const void *global_state)
{
return IS_ENABLED(CONFIG_THINGSET_TEXT_MODE);
}

static void *thingset_setup(void)
{
thingset_init_global(&ts);

return NULL;
}

ZTEST_SUITE(thingset_txt, NULL, thingset_setup, NULL, NULL, NULL);
ZTEST_SUITE(thingset_txt, thingset_txt_predicate, thingset_setup, NULL, NULL, NULL);
7 changes: 7 additions & 0 deletions tests/protocol/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ tests:
- native_posix
- native_posix_64
extra_args: EXTRA_CFLAGS=-Werror
thingset.protocol.text_mode_disabled:
integration_platforms:
- native_posix
- native_posix_64
extra_args: EXTRA_CFLAGS=-Werror
extra_configs:
- CONFIG_THINGSET_TEXT_MODE=n
thingset.protocol.objectlookup:
integration_platforms:
- native_posix
Expand Down

0 comments on commit 0389f4a

Please sign in to comment.