zephyr/samples/microkernel/test/test_task
Benjamin Walsh d3084b41e6 test_task: improve task_sleep test reliability on QEMU
The test was doing some weird dance for computing the time the main task
had slept, context switching between the main task and a helper task.
The tick timestamp that marks the start of the sleep duration, which
should be taken before the main task goes to sleep actually was taken
after it went to sleep, by the helper task. This lead to weird results
sometimes on QEMU, where the main task would report that it had slept
for less time than requested.

Now instead, the main task takes its own tick timestamps, just before it
goes to sleep and right when it awakens.

The helper task takes a timestamp as well, to verify that it did do busy
work while the main task was sleeping. However, some error is allowed
there to compensate for some QEMU weirdness.

Change-Id: I4b642b49de8346be404000698eaa4ded070d4097
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:25 -05:00
..
src test_task: improve task_sleep test reliability on QEMU 2016-02-05 20:15:25 -05:00
Makefile Renames supported platform configurations 2016-02-05 20:14:39 -05:00
README.txt Update Title in sample project README.txt files 2016-02-05 20:15:21 -05:00
prj.mdef Rename VPF files to use MDEF file extension 2016-02-05 20:14:15 -05:00
prj_arm.conf Configure number of task priorities for sample projects 2016-02-05 20:13:48 -05:00
prj_x86.conf irq_connect for x86 uses static stub array 2016-02-05 20:14:25 -05:00
testcase.ini initial commit for next-gen sanity checks 2016-02-05 20:14:42 -05:00

README.txt

Title: Task APIs

Description:

This test verifies that the microkernel task APIs operate as expected.

--------------------------------------------------------------------------------

Building and Running Project:

This microkernel project outputs to the console.  It can be built and executed
on QEMU as follows:

    make qemu

--------------------------------------------------------------------------------

Troubleshooting:

Problems caused by out-dated project information can be addressed by
issuing one of the following commands then rebuilding the project:

    make clean          # discard results of previous builds
                        # but keep existing configuration info
or
    make pristine       # discard results of previous builds
                        # and restore pre-defined configuration info

--------------------------------------------------------------------------------

Sample Output:

tc_start() - Test Microkernel Task API
===================================================================
Microkernel objects initialized
Testing isr_task_id_get() and isr_task_priority_get()
Testing task_id_get() and task_priority_get()
Testing task_priority_set()
Testing task_sleep()
Testing task_yield()
Testing task_suspend() and task_resume()
===================================================================
PASS - RegressionTask.
===================================================================
PROJECT EXECUTION SUCCESSFUL