tests: re-order test naming pattern

The string from get_test_name() can be used for writing screenshot files and
others. Starting the name with the fixture number makes an alphabetized listing
of output files look unorganized.

Let's change the test name to begin with the test (source) name with fixture
and element numbers as suffixes. That makes a file listing easier to look
through, when you have multiple tests each saving multiple screenshot files.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 5 years ago
parent 1eb30468ea
commit 444f1a8e22
  1. 14
      tests/weston-test-runner.c

@ -55,9 +55,9 @@ static const struct weston_test_run_info *test_run_info_;
/** Get the test name string with counter /** Get the test name string with counter
* *
* \return The test name with fixture number \c f%%d- prefixed. For an array * \return The test name with fixture number \c -f%%d added. For an array
* driven test, e.g. defined with TEST_P(), the name has a \c -e%%d suffix to * driven test, e.g. defined with TEST_P(), the name has also a \c -e%%d
* indicate the array element number. * suffix to indicate the array element number.
* *
* This is only usable from code paths inside TEST(), TEST_P(), PLUGIN_TEST() * This is only usable from code paths inside TEST(), TEST_P(), PLUGIN_TEST()
* etc. defined functions. * etc. defined functions.
@ -124,11 +124,11 @@ run_test(int fixture_nr, const struct weston_test_entry *t, void *data,
struct weston_test_run_info info; struct weston_test_run_info info;
if (data) { if (data) {
snprintf(info.name, sizeof(info.name), "f%d-%s-e%d", snprintf(info.name, sizeof(info.name), "%s-f%02d-e%02d",
fixture_nr, t->name, iteration); t->name, fixture_nr, iteration);
} else { } else {
snprintf(info.name, sizeof(info.name), "f%d-%s", snprintf(info.name, sizeof(info.name), "%s-f%02d",
fixture_nr, t->name); t->name, fixture_nr);
} }
info.fixture_nr = fixture_nr; info.fixture_nr = fixture_nr;

Loading…
Cancel
Save