FreeRTOS-Kernel/FreeRTOS/Test/Target/tests/smp/template
chinglee-iot 8422d79383
Update on target test for passive idle hook (#1128)
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2024-01-31 16:02:12 +08:00
..
README.md Update on target test for passive idle hook (#1128) 2024-01-31 16:02:12 +08:00
test_config.h Update on target test for passive idle hook (#1128) 2024-01-31 16:02:12 +08:00
test_name.c Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083) 2023-09-06 12:35:37 -07:00

How to add a new test?

  1. Create a directory in the FreeRTOS/Test/Target/tests directory which will contain the test. For example: FreeRTOS/Test/Target/tests/smp/multiple_tasks_running.
  2. Copy the test_name.c and test_config.h files from this template directory to the newly created directory above.
  3. Rename the test_name.c according to the test name.
  4. Implement the test in the above test file.
  5. Add any FreeRTOS specific configuration required for the test to test_config.h.

How to add a new target?

  1. Create a target specific directory in the FreeRTOS/Test/Target/boards directory.
  2. Create required build files.
    • Include test_config.h in FreeRTOSConfig.h at the end.
    • Ensure that the following configurations are not defined in FreeRTOSConfig.h as those are defined in test_config.h:
      • configRUN_MULTIPLE_PRIORITIES
      • configUSE_CORE_AFFINITY
      • configUSE_TASK_PREEMPTION_DISABLE
      • configUSE_TIME_SLICING
      • configUSE_PREEMPTION

How to add a test to a target

  1. Create a directory in the target's directory which will contain the test. For example: FreeRTOS/Test/Target/boards/pico/tests/smp/multiple_tasks_running.
  2. Create a C file and invoke the test case from a task. The invocation usually looks like the following:
    void prvTestRunnerTask( void * pvParameters )
    {
        /* Invoke the test case. */
        vRunTestCaseName();
    }
    
  3. Add the file created above and the test case file to the build system used for the target.