Skip to content

Commit

Permalink
cheribsdtest: Track which test is running
Browse files Browse the repository at this point in the history
While a test is running via cheribsdtest_run_test(), maintain a global
pointing to the test structure.  This intended to be used by
infrastucture that needs to acccess test-specific data from the test
function itself.
  • Loading branch information
brooksdavis committed Aug 17, 2023
1 parent 82e70e9 commit 1230eea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/cheribsdtest/cheribsdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ static StringList* cheri_xpassed_tests;
/* Shared memory page with child process. */
struct cheribsdtest_child_state *ccsp;

static const struct cheri_test *running_test;

static int tests_run, tests_skipped;
static int tests_failed, tests_passed, tests_xfailed, tests_xpassed;
static int expected_failures;
Expand Down Expand Up @@ -366,7 +368,9 @@ cheribsdtest_run_test(const struct cheri_test *ctp)
}

/* Run the actual test. */
running_test = ctp;
ctp->ct_func();
running_test = NULL;
exit(0);
}
close(pipefd_stdin[0]);
Expand Down

0 comments on commit 1230eea

Please sign in to comment.