-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: posix: common: separate posix c_lib_ext to standalone test #81441
tests: posix: common: separate posix c_lib_ext to standalone test #81441
Conversation
b2e9176
to
c0122d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also move the getentropy and getopt tests to the new directory in this PR as well.
Note: getentropy()
was added as part of the 2024 revision but was not part of the 2008 revision.
https://pubs.opengroup.org/onlinepubs/9799919799/xrat/V4_subprofiles.html
232585b
to
dd22cbc
Compare
dd22cbc
to
1083082
Compare
@Pancakem - this would do it for me. For the diff --git a/tests/posix/c_lib_ext/CMakeLists.txt b/tests/posix/c_lib_ext/CMakeLists.txt
index e607b5283b5..24c7cfd2194 100644
--- a/tests/posix/c_lib_ext/CMakeLists.txt
+++ b/tests/posix/c_lib_ext/CMakeLists.txt
@@ -8,4 +8,5 @@ FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
+target_include_directories(app PRIVATE ${ZEPHYR_BASE}/lib/posix/options/getopt)
target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)
diff --git a/tests/posix/c_lib_ext/prj.conf b/tests/posix/c_lib_ext/prj.conf
index 55affe2f7f8..7e8b0675c52 100644
--- a/tests/posix/c_lib_ext/prj.conf
+++ b/tests/posix/c_lib_ext/prj.conf
@@ -1,4 +1,3 @@
-CONFIG_POSIX_API=y
CONFIG_ZTEST=y
CONFIG_POSIX_C_LIB_EXT=y
diff --git a/tests/posix/c_lib_ext/src/fnmatch.c b/tests/posix/c_lib_ext/src/fnmatch.c
index 0faf8492829..66b6aadf86d 100644
--- a/tests/posix/c_lib_ext/src/fnmatch.c
+++ b/tests/posix/c_lib_ext/src/fnmatch.c
@@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <fnmatch.h>
-
+#include <zephyr/posix/fnmatch.h>
#include <zephyr/ztest.h>
/*
diff --git a/tests/posix/c_lib_ext/src/getentropy.c b/tests/posix/c_lib_ext/src/getentropy.c
index b41527a9c50..f04e54becb0 100644
--- a/tests/posix/c_lib_ext/src/getentropy.c
+++ b/tests/posix/c_lib_ext/src/getentropy.c
@@ -4,9 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
-#include <zephyr/ztest.h>
-
#include <zephyr/posix/unistd.h>
+#include <zephyr/ztest.h>
ZTEST(posix_c_lib_ext, test_getentropy_too_large)
{
diff --git a/tests/posix/c_lib_ext/src/getopt.c b/tests/posix/c_lib_ext/src/getopt.c
index 826d8d9be8a..febe55c3468 100644
--- a/tests/posix/c_lib_ext/src/getopt.c
+++ b/tests/posix/c_lib_ext/src/getopt.c
@@ -9,11 +9,12 @@
*
*/
-#include <zephyr/kernel.h>
-#include <zephyr/ztest.h>
+#include <getopt.h>
#include <string.h>
+
+#include <zephyr/kernel.h>
#include <zephyr/posix/unistd.h>
-#include <getopt.h>
+#include <zephyr/ztest.h>
ZTEST(posix_c_lib_ext, test_getopt_basic)
{
|
1083082
to
608e48e
Compare
I think there is likely an unrelated test failing in main, so this will just need a rebase at some point |
@Pancakem - this should basically be ready to go after a rebase |
608e48e
to
a81b463
Compare
504a02a
to
3839829
Compare
posix.common contains testsuites that can be separated into smaller groups of tests. This change moves fnmatch, getopt and getentropy into a singular testsuite at tests/posix/c_lib_ext app directory. Signed-off-by: Marvin Ouma <[email protected]>
3839829
to
35cfa54
Compare
Fixes #81488
posix.common contains testsuites that can be separated into smaller groups of tests. This change moves fnmatch into a singular testsuite at tests/posix/c_lib_ext app directory.