FreeRTOS-Kernel/FreeRTOS/Test/Target/tests/smp/template
ActoryOu 67911f83a6
Create SMP on target test framework. (#911)
* Framework initialization.

* Move testRunner.c to test case subfolder.

* Update README doc and formatting.

* Add default configurations in test_config.h.

* Fix License & formatting check.

* Fix typo.

* Move setup/teardown functions to main.c file.

* Move setup/teardown functions back.

* Update README doc.

* Patch for comments.

* Correct test runner file name.

* Move test_config.h to the end of FreeRTOSConfig.h.

* Add undef in test_config.h and description in README doc.

* Correct the file format.

* Fix chinglee-iot comments.

* Code review suggestions

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Fix spell check

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2023-03-06 13:17:27 +05:30
..
README.md Create SMP on target test framework. (#911) 2023-03-06 13:17:27 +05:30
test_config.h Create SMP on target test framework. (#911) 2023-03-06 13:17:27 +05:30
test_name.c Create SMP on target test framework. (#911) 2023-03-06 13:17:27 +05:30

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_MINIMAL_IDLE_HOOK
      • 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.