Commit Graph

73 Commits

Author SHA1 Message Date
Sebastian Huber
6aa0552403 libtest: Increase line length
Update #3716.
2022-03-24 11:10:48 +01:00
Sebastian Huber
cc1c944042 libtest: Add scheduler test support
Add support to record scheduler operations.  This support is especially
important for tests in SMP configurations since the thread switch extension is
quite difficult to use due to the asynchronous nature of thread dispatching.
In contrast, the scheduler operations occur normally in a deterministic order.

Update #3716.
2022-03-24 11:10:48 +01:00
Joel Sherrill
1db3d3c3ee cpukit/libtest: Change license to BSD-2
Updates #3053.
2022-03-22 11:34:23 -05:00
Joel Sherrill
255fe433fd cpukit/: Scripted embedded brains header file clean up
Updates #4625.
2022-03-10 08:43:49 +01:00
Sebastian Huber
8657986989 libtest: Check for pending events
Make sure there are no pending events after a test case.
2021-12-22 10:29:13 +01:00
Sebastian Huber
e543a1695b libtest: Fix sample reporting
The sample reporting wronly added values to the wrong bin in some cases.
2021-12-07 12:53:40 +01:00
Sebastian Huber
5e3607bc7d libtest: Fix overlap in measurement context 2021-12-07 12:53:39 +01:00
Sebastian Huber
69aaf58745 libtest: Improve the interrupt test timing
If no state change occurred during the test action, then assume a late
interrupt.
2021-11-15 08:56:53 +01:00
Sebastian Huber
0221da5f56 rtems: Fix rate monotonic statistics
The rate monotonic period statistics were affected by
rtems_cpu_usage_reset().  The logic to detect and work around a CPU
usage reset was broken.

The Thread_Contol::cpu_time_used is changed to contain the processor
time used throughout the entire lifetime of the thread.  The new member
Thread_Contol::cpu_time_used_at_last_reset is added to contain the
processor time used at the time of the last reset through
rtems_cpu_usage_reset().  This decouples the resets of the CPU usage and
the rate monotonic period statistics.

Update #4528.
2021-10-25 08:01:02 +02:00
Sebastian Huber
a6636d9957 libtest: Improve T_now_tick()
The T_now_tick() is a fall back time measurement using the CPU counter
in case no Clock Driver is configured.  Some CPU counter may overflow
during the test execution.  Accumulate the elapsed time to reduce the
chance of CPU counter overflows.
2021-09-21 07:39:09 +02:00
Sebastian Huber
34099baa9c libtest: Return fixture context in T_case_begin()
This makes it similar to T_push_fixture().
2021-09-02 08:54:58 +02:00
Sebastian Huber
98a57511b6 score: Add _Per_CPU_Submit_job() 2021-07-29 09:03:50 +02:00
Sebastian Huber
5b97821bc8 libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
2021-05-03 06:58:53 +02:00
Sebastian Huber
c96644e873 libtest: Print SHA256 hash in base64url 2021-02-26 09:10:09 +01:00
Sebastian Huber
74eff26c1d libtest: Report target hash
Update #4267.
2021-02-26 09:10:09 +01:00
Sebastian Huber
da8ad67e88 libtest: Report build label
Update #4269.
2021-02-25 16:16:20 +01:00
Sebastian Huber
5be6e61481 libtest: Add support to seize/surrender objects 2021-02-24 09:22:36 +01:00
Sebastian Huber
788fa865fb libtest: Add T_get_thread_timer_state() 2021-02-08 08:44:14 +01:00
Sebastian Huber
8f7baef4a6 libtest: Remove double definition 2021-02-01 14:19:28 +01:00
Sebastian Huber
23f4e5b6c9 libtest: Fix implicit type conversions
This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).
2021-02-01 06:22:20 +01:00
Sebastian Huber
3b8137b094 libtest: Check return values with RTEMS_DEBUG
This fix relates to a Coverity issue (UNINIT).
2021-02-01 06:22:20 +01:00
Sebastian Huber
e269e389ea libtest: Remove superfluous NULL pointer check
This fix relates to CID 1468683 (REVERSE_INULL).
2021-01-27 19:08:29 +01:00
Sebastian Huber
426b6cdba9 libtest: Use dependency injection
This helps static analyzers.
2021-01-27 19:08:29 +01:00
Sebastian Huber
aa1c6ddd5c libtest: Fix undefined setjmp() behaviour
Bug was introduced by 78baeb7579.

Update #3199.
2020-11-24 07:38:41 +01:00
Sebastian Huber
c542345b25 libtest: Simplify "Load" environment reporting
Report all runtime measurement environments with a name only and encode
the worker count of the "Load" environment in the name.

Update #3199.
2020-11-19 08:39:02 +01:00
Sebastian Huber
78baeb7579 libtest: Allow assert checks during test begin
Allow assert checks in test begin actions and setup fixture methods.
2020-11-19 08:39:02 +01:00
Sebastian Huber
d2bc5945d3 libtest: Rename ValidCache in FullCache
This name better reflects the execution envirnoment in which the cache
is fully loaded with valid data unrelated to the body request handler.
2020-11-19 08:39:02 +01:00
Sebastian Huber
8882635636 libtest: Add primitive test case memory allocator
This primitive test case memory allocator uses memory from the low-level
memory information provided by the BSP.  At the beginning of each test
case, the memory available to the test case is reinitialized.  This
allows the use of a simple allocate only allocator.
2020-11-19 08:39:02 +01:00
Sebastian Huber
33cd037bf1 libtest: Simplify runtime measurement support
Use the test case allocator functions T_zalloc() and T_malloc().
Restore the task affinity of the runner task.
2020-11-19 08:39:02 +01:00
Sebastian Huber
eae22cc03e libtest: Make test case allocator configurable 2020-11-19 08:39:02 +01:00
Sebastian Huber
a72419b4de libtest: Remove superfluous assignment
Issue found by Coverity (CID 1437643).
2020-09-24 18:07:50 +02:00
Sebastian Huber
98d2adb935 libtest: Fix T_thread_switch_record()
If RTEMS_DEBUG is not defined, then we have to explicitly set the node
off the chain.

Update #3199.
2020-09-17 17:42:25 +02:00
Sebastian Huber
c728948434 libtest: Add T_push_plan() and T_pop_plan()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
13acd90003 libtest: Use a destructor
Do not set up a new test steps environment.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
72960bc7d4 libtest: Change T_step() and T_assert_step()
Normally, the expected test step must be a compile time constant.  Allow
variable expected test steps for the T_step() and T_assert_step().  This
can be used for parameterized test loops with individual fixtures.

Remove the ability to use custom failure messages due to some
implementation constraints.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5383d4db04 libtest: Add fixture steps
Support a new test plan for each nested fixture.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
33eb113c36 libtest: Add T_check_steps()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
cbc1ba341d libtest: Use line buffer in T_check()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5d614fdfa7 libtest: Add T_puts()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
a7af34d0cf libtest: Add T_do_is_runner()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
e67eff2b53 libtest: Add output buffer drain and fill
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5a8114c6c5 libtest: Change fixture scope method
Return the produced character count.  There is no need for a NUL
termination.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
c1354f0514 libtest: Add T_thread_switch_record()
Add support to record thread switch events.  This can be used to check
that a blocking operation results in the expected sequence of thread
switches.

Update #3199.
2020-08-11 08:03:47 +02:00
Sebastian Huber
20c79bf5eb libtest: Constify
Update #3199.
2020-08-10 11:49:28 +02:00
Sebastian Huber
f933b651e7 libtest: Improve T_check_task_context
Update #3199.
2020-08-07 18:09:56 +02:00
Sebastian Huber
32f1f747cc libtest: Fix T_interrupt_test() in SMP configs
Update #3199.
2020-08-06 19:15:57 +02:00
Sebastian Huber
cc3fd8fcf1 libtest: Add T_interrupt_test()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
c9d2405848 libtest: Add rtems_test_run()
Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
35d9af6901 libtest: Add T_CHECK_FMT
Rename internal function T_check_true() to T_check() and use the new
flag T_CHECK_FMT to indicate if a format string is present.  This is a
preparation step to make the format string optional.

Make the check context the first parameter.

The API remains the same.

Update #3199.
2020-07-23 09:27:47 +02:00
Sebastian Huber
7781404026 libtest: Add T_stop()
Update #3199.
2020-07-23 09:27:47 +02:00