Skip to content
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 threads base into a standalone test #81339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pancakem
Copy link
Contributor

@Pancakem Pancakem commented Nov 13, 2024

Fixes #81491

posix.common contains testsuites that can be separated into smaller groups of tests. This change moves pthread, cond, key, mutex and mutex_attr into a singular testsuite at tests/posix/thread_base app directory.

@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Nov 13, 2024
@zephyrbot zephyrbot requested review from cfriedt and ycsin November 13, 2024 13:00
@Pancakem Pancakem force-pushed the separate_posix_thread_base_test_into_standalone_test branch 2 times, most recently from fcee92c to 88d572c Compare November 13, 2024 13:13
@cfriedt cfriedt changed the title tests: posix: common: separate posix thread base into a standalone test tests: posix: common: separate posix threads base into a standalone test Nov 17, 2024
@Pancakem Pancakem force-pushed the separate_posix_thread_base_test_into_standalone_test branch from 88d572c to 4f4b818 Compare November 27, 2024 12:12
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please substitute

/posix_thread_base/posix_threads_base/g

@Pancakem Pancakem force-pushed the separate_posix_thread_base_test_into_standalone_test branch 3 times, most recently from 831747c to 4328024 Compare December 2, 2024 17:17
Comment on lines 449 to 542
ZTEST(pthread, test_pthread_set_get_concurrency)
{
/* EINVAL if the value specified by new_level is negative */
zassert_equal(EINVAL, pthread_setconcurrency(-42));

/*
* Note: the special value 0 indicates the implementation will
* maintain the concurrency level at its own discretion.
*
* pthread_getconcurrency() should return a value of 0 on init.
*/
zassert_equal(0, pthread_getconcurrency());

for (int i = 0; i <= CONFIG_MP_MAX_NUM_CPUS; ++i) {
zassert_ok(pthread_setconcurrency(i));
/* verify parameter is saved */
zassert_equal(i, pthread_getconcurrency());
}

/* EAGAIN if the a system resource to be exceeded */
zassert_equal(EAGAIN, pthread_setconcurrency(CONFIG_MP_MAX_NUM_CPUS + 1));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the XSI_THREADS_EXT option group, so should not be modified in this PR

@cfriedt
Copy link
Member

cfriedt commented Dec 3, 2024

This needs a minor change. Also, I think it should only be merged after #81613 and #81858 are merged.

@Pancakem Pancakem force-pushed the separate_posix_thread_base_test_into_standalone_test branch from 4328024 to c3b8b4a Compare December 17, 2024 08:50
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves pthread into a singular
testsuite at tests/posix/thread_base app directory.

Signed-off-by: Marvin Ouma <[email protected]>
@Pancakem Pancakem force-pushed the separate_posix_thread_base_test_into_standalone_test branch from c3b8b4a to 01587a7 Compare December 17, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: posix: common: split posix_threads_base tests into standalone test
3 participants