diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 73f11638..727160aa 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -29,6 +29,8 @@ if (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU") add_compile_options(-Wno-unused-variable) add_compile_options(-Wno-unused-function) add_compile_options(-Wno-unused-parameter) + # FIXME: zephyr ztest has a strnlen hack in platform.h which triggers this warning + add_compile_options(-Wno-redundant-decls) add_link_options(-fprofile-arcs -ftest-coverage) endif() diff --git a/test/ztest/include/zephyr/ztest_assert.h b/test/ztest/include/zephyr/ztest_assert.h index 6925118a..216bcc19 100644 --- a/test/ztest/include/zephyr/ztest_assert.h +++ b/test/ztest/include/zephyr/ztest_assert.h @@ -13,7 +13,7 @@ #ifndef ZEPHYR_TESTSUITE_ZTEST_ASSERT_H_ #define ZEPHYR_TESTSUITE_ZTEST_ASSERT_H_ -#include +#include #include #include #include @@ -24,7 +24,6 @@ extern "C" { #endif const char *ztest_relative_filename(const char *file); -void ztest_test_fail(void); #if CONFIG_ZTEST_ASSERT_VERBOSE == 0 static inline bool z_zassert_(bool cond, const char *file, int line) diff --git a/test/ztest/include/zephyr/ztest_test.h b/test/ztest/include/zephyr/ztest_test.h index efb91b5e..e983d6b7 100644 --- a/test/ztest/include/zephyr/ztest_test.h +++ b/test/ztest/include/zephyr/ztest_test.h @@ -24,6 +24,10 @@ #ifndef ZEPHYR_TESTSUITE_ZTEST_TEST_H_ #define ZEPHYR_TESTSUITE_ZTEST_TEST_H_ +#include +#include +#include + #if 0 /* __ZEPHYR__ */ #include #endif /* __ZEPHYR__ */ diff --git a/ztest.sh b/ztest.sh new file mode 100755 index 00000000..6b0724ac --- /dev/null +++ b/ztest.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +rm -rf twister-out.unit_testing +../zephyr/scripts/twister -O twister-out.unit_testing -p unit_testing -T zephyr/tests +#for file in CMakeFiles CMakeCache.txt cmake_install.cmake Makefile +#do +# find twister-out.unit_testing -name $file -exec rm -rf {} \; || true +#done