Skip to content

Commit

Permalink
tests: schedule_api: skip test assert if COVERAGE
Browse files Browse the repository at this point in the history
This test case is so timing sensitive that gathering code
coverage data screws up the results.

Since this is an abnormal execution environment anyway,
just skip the assertions if CONFIG_COVERAGE=y.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
  • Loading branch information
Andrew Boie authored and nashif committed Jun 19, 2019
1 parent 03f2277 commit 6020a50
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/kernel/sched/schedule_api/src/test_sched_timeslice_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ static void thread_tslice(void *p1, void *p2, void *p3)
#endif

/** TESTPOINT: timeslice should be reset for each preemptive thread*/
zassert_true(t >= expected_slice_min, NULL);
zassert_true(t <= expected_slice_max, NULL);
#ifndef CONFIG_COVERAGE
zassert_true(t >= expected_slice_min,
"timeslice too small, expected %u got %u",
expected_slice_min, t);
zassert_true(t <= expected_slice_max,
"timeslice too big, expected %u got %u",
expected_slice_max, t);
#else
(void)t;
#endif /* CONFIG_COVERAGE */
thread_idx = (thread_idx + 1) % NUM_THREAD;

/* Keep the current thread busy for more than one slice, even though,
Expand Down

0 comments on commit 6020a50

Please sign in to comment.