Changeset b5e61f95 in rtems


Ignore:
Timestamp:
Oct 2, 2019, 6:04:42 AM (3 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e71f0a5
Parents:
5a1df5e
git-author:
Sebastian Huber <sebastian.huber@…> (10/02/19 06:04:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/11/19 06:55:53)
Message:

libtest: Add more action events

This allows more control over the initialization and finalization run.

Update #3199.

Location:
cpukit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/t.h

    r5a1df5e rb5e61f95  
    21862186
    21872187typedef enum {
    2188         T_EVENT_RUN_INITIALIZE,
     2188        T_EVENT_RUN_INITIALIZE_EARLY,
     2189        T_EVENT_RUN_INITIALIZE_LATE,
    21892190        T_EVENT_CASE_EARLY,
    21902191        T_EVENT_CASE_BEGIN,
    21912192        T_EVENT_CASE_END,
    21922193        T_EVENT_CASE_LATE,
    2193         T_EVENT_RUN_FINALIZE
     2194        T_EVENT_RUN_FINALIZE_EARLY,
     2195        T_EVENT_RUN_FINALIZE_LATE
    21942196} T_event;
    21952197
  • cpukit/libtest/t-test-hash-sha256.c

    r5a1df5e rb5e61f95  
    8989
    9090        switch (event) {
    91         case T_EVENT_RUN_INITIALIZE:
     91        case T_EVENT_RUN_INITIALIZE_EARLY:
    9292                T_report_hash_sha256_initialize();
    9393                break;
    94         case T_EVENT_RUN_FINALIZE:
     94        case T_EVENT_RUN_FINALIZE_LATE:
    9595                T_report_hash_sha256_finalize();
    9696                break;
  • cpukit/libtest/t-test-rtems-fds.c

    r5a1df5e rb5e61f95  
    7272
    7373        switch (event) {
    74         case T_EVENT_RUN_INITIALIZE:
     74        case T_EVENT_RUN_INITIALIZE_EARLY:
    7575                T_open_fds = T_count_open_fds();
    7676                break;
  • cpukit/libtest/t-test-rtems-heap.c

    r5a1df5e rb5e61f95  
    101101
    102102        switch (event) {
    103         case T_EVENT_RUN_INITIALIZE:
     103        case T_EVENT_RUN_INITIALIZE_EARLY:
    104104                T_heap_run_initialize();
    105105                break;
  • cpukit/libtest/t-test-rtems-objs.c

    r5a1df5e rb5e61f95  
    9595
    9696        switch (event) {
    97         case T_EVENT_RUN_INITIALIZE:
     97        case T_EVENT_RUN_INITIALIZE_EARLY:
    9898                T_rtems_barriers_run_initialize();
    9999                break;
     
    128128
    129129        switch (event) {
    130         case T_EVENT_RUN_INITIALIZE:
     130        case T_EVENT_RUN_INITIALIZE_EARLY:
    131131                T_rtems_extensions_run_initialize();
    132132                break;
     
    161161
    162162        switch (event) {
    163         case T_EVENT_RUN_INITIALIZE:
     163        case T_EVENT_RUN_INITIALIZE_EARLY:
    164164                T_rtems_message_queues_run_initialize();
    165165                break;
     
    194194
    195195        switch (event) {
    196         case T_EVENT_RUN_INITIALIZE:
     196        case T_EVENT_RUN_INITIALIZE_EARLY:
    197197                T_rtems_partitions_run_initialize();
    198198                break;
     
    227227
    228228        switch (event) {
    229         case T_EVENT_RUN_INITIALIZE:
     229        case T_EVENT_RUN_INITIALIZE_EARLY:
    230230                T_rtems_periods_run_initialize();
    231231                break;
     
    260260
    261261        switch (event) {
    262         case T_EVENT_RUN_INITIALIZE:
     262        case T_EVENT_RUN_INITIALIZE_EARLY:
    263263                T_rtems_regions_run_initialize();
    264264                break;
     
    293293
    294294        switch (event) {
    295         case T_EVENT_RUN_INITIALIZE:
     295        case T_EVENT_RUN_INITIALIZE_EARLY:
    296296                T_rtems_semaphores_run_initialize();
    297297                break;
     
    330330
    331331        switch (event) {
    332         case T_EVENT_RUN_INITIALIZE:
     332        case T_EVENT_RUN_INITIALIZE_EARLY:
    333333                T_rtems_tasks_run_initialize();
    334334                break;
     
    363363
    364364        switch (event) {
    365         case T_EVENT_RUN_INITIALIZE:
     365        case T_EVENT_RUN_INITIALIZE_EARLY:
    366366                T_rtems_timers_run_initialize();
    367367                break;
     
    436436
    437437        switch (event) {
    438         case T_EVENT_RUN_INITIALIZE:
     438        case T_EVENT_RUN_INITIALIZE_EARLY:
    439439                T_posix_keys_run_initialize();
    440440                break;
  • cpukit/libtest/t-test.c

    r5a1df5e rb5e61f95  
    646646
    647647static void
    648 T_call_actions_forward(const T_config *config, T_event event, const char *name)
     648T_actions_forward(const T_config *config, T_event event, const char *name)
    649649{
    650650        const T_action *actions;
     
    661661
    662662static void
    663 T_call_actions_backward(const T_config *config, T_event event,
     663T_actions_backward(const T_config *config, T_event event,
    664664    const char *name)
    665665{
     
    707707
    708708        T_set_runner(ctx);
    709         T_call_actions_forward(config, T_EVENT_RUN_INITIALIZE, config->name);
     709        T_actions_forward(config, T_EVENT_RUN_INITIALIZE_EARLY, config->name);
    710710        T_do_log(ctx, T_QUIET, "A:%s\n", config->name);
    711711        T_system(ctx);
    712712        ctx->run_begin_time = (*config->now)();
     713        T_actions_forward(config, T_EVENT_RUN_INITIALIZE_LATE, config->name);
    713714
    714715        return ctx;
     
    731732        atomic_store_explicit(&ctx->failures, 0, memory_order_relaxed);
    732733
    733         T_call_actions_forward(config, T_EVENT_CASE_EARLY, tc->name);
     734        T_actions_forward(config, T_EVENT_CASE_EARLY, tc->name);
    734735        T_do_log(ctx, T_NORMAL, "B:%s\n", tc->name);
    735736        ctx->case_begin_time = (*config->now)();
    736         T_call_actions_forward(config, T_EVENT_CASE_BEGIN, tc->name);
     737        T_actions_forward(config, T_EVENT_CASE_BEGIN, tc->name);
    737738
    738739        if (fixture != NULL) {
     
    764765
    765766        T_call_destructors(ctx);
    766         T_call_actions_backward(config, T_EVENT_CASE_END, tc->name);
     767        T_actions_backward(config, T_EVENT_CASE_END, tc->name);
    767768
    768769        planned_steps = atomic_fetch_add_explicit(&ctx->planned_steps,
     
    794795        ctx->overall_failures += failures;
    795796
    796         T_call_actions_backward(config, T_EVENT_CASE_LATE, tc->name);
     797        T_actions_backward(config, T_EVENT_CASE_LATE, tc->name);
    797798}
    798799
     
    830831
    831832        config = ctx->config;
     833        T_actions_backward(config, T_EVENT_RUN_FINALIZE_EARLY, config->name);
    832834        delta = (*config->now)() - ctx->run_begin_time;
    833835        T_do_log(ctx, T_QUIET, "Z:%s:C:%u:N:%u:F:%u:D:%s\n", config->name,
    834836            ctx->overall_cases, ctx->overall_steps, ctx->overall_failures,
    835837            T_time_to_string_us(delta, ts));
    836         T_call_actions_backward(config, T_EVENT_RUN_FINALIZE, config->name);
     838        T_actions_backward(config, T_EVENT_RUN_FINALIZE_LATE, config->name);
    837839#ifdef __rtems__
    838840        ctx->runner_thread = NULL;
Note: See TracChangeset for help on using the changeset viewer.