Add CMock+Unity unit tests for FreeRTOS-Kernel PR #1418#74
Open
chinglee-iot wants to merge 1 commit into
Open
Conversation
Add a new SMP test suite scheduler_core_mask covering the vTaskSetSchedulerCoreMask() and uxTaskGetSchedulerCoreMask() APIs introduced by FreeRTOS/FreeRTOS-Kernel#1418. Also add taskTASK_SCHEDULED_TO_YIELD alias to global_vars.h so that test files can reference the same macro name used in tasks.c.
f3fbfe0 to
b4dd327
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds CMock + Unity unit tests for the changes introduced
in FreeRTOS-Kernel PR #1418,
which adds the
vTaskSetSchedulerCoreMask()anduxTaskGetSchedulerCoreMask()APIs for per-core scheduler masking in SMP builds.
Kernel PR: FreeRTOS/FreeRTOS-Kernel#1418
New test suite:
FreeRTOS/Test/CMock/smp/scheduler_core_mask/Functional test plan
The following scenarios are verified end-to-end via the public API:
test_vTaskSetSchedulerCoreMask_before_scheduler_startstest_uxTaskGetSchedulerCoreMask_returns_current_masktest_uxTaskGetSchedulerCoreMask_while_scheduler_runningtest_vTaskSetSchedulerCoreMask_all_cores_enabledtest_vTaskSetSchedulerCoreMask_disable_core_running_nonidletest_vTaskSetSchedulerCoreMask_enable_previously_disabled_coreCoverage test plan
The following branch conditions not reachable via the public API are covered
by the coverage test file:
test_coverage_vTaskSetSchedulerCoreMask_invalid_maskconfigASSERTfalse-branch (tasks.c:3150) — out-of-range masktest_coverage_vTaskSetSchedulerCoreMask_disable_core_idle_taskprvYieldCoreNOT called (tasks.c:3181 branch 1)test_coverage_vTaskSetSchedulerCoreMask_disable_current_coreprvYieldCoresame-core path →xYieldPendingsset instead ofportYIELD_CORE(tasks.c:3183 branch 0)test_coverage_vTaskSetSchedulerCoreMask_enable_current_corexYieldPendingspath (tasks.c:3188 branch 0)test_coverage_prvSelectHighestPriorityTask_preemption_disabled_coretest_coverage_prvSelectHighestPriorityTask_disabled_core_not_runningtest_coverage_prvSelectHighestPriorityTask_disabled_core_already_runningTest results
Test Steps
Checklist:
Related Issue
FreeRTOS-Kernel PR #1418: FreeRTOS/FreeRTOS-Kernel#1418
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.