Show the filename of the test being run. Skip the path and show just the
base name.
Signed-off-by: Simon Glass <sjg@chromium.org>
* @flags: Flags indicated pre-conditions for test
*/
struct unit_test {
+ const char *file;
const char *name;
int (*func)(struct unit_test_state *state);
int flags;
/* Declare a new unit test */
#define UNIT_TEST(_name, _flags, _suite) \
ll_entry_declare(struct unit_test, _name, _suite) = { \
+ .file = __FILE__, \
.name = #_name, \
.flags = _flags, \
.func = _name, \
static int dm_do_test(struct unit_test_state *uts, struct unit_test *test)
{
struct sandbox_state *state = state_get_current();
+ const char *fname = strrchr(test->file, '/') + 1;
- printf("Test: %s\n", test->name);
+ printf("Test: %s: %s\n", test->name, fname);
ut_assertok(dm_test_init(uts));
uts->start = mallinfo();