tests: replace fprintf() with testlog()
authorPekka Paalanen <pekka.paalanen@collabora.com>
Wed, 6 Nov 2019 13:59:33 +0000 (15:59 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 22 Nov 2019 10:54:10 +0000 (12:54 +0200)
When we move on to TAP, stdout will be reserved for TAP and stderr is for free
chatter. Set up an example that tests should use testlog() instead of fprintf
or printf to chat in the right place.

Most statements were already printing to stderr, so this just makes then a
little shorter. There are also some statements that printed to stdout and are
now corrected.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
12 files changed:
tests/input-timestamps-helper.c
tests/internal-screenshot-test.c
tests/ivi-layout-test-client.c
tests/ivi-shell-app-test.c
tests/presentation-test.c
tests/subsurface-shot-test.c
tests/subsurface-test.c
tests/text-test.c
tests/viewporter-test.c
tests/weston-test-client-helper.c
tests/weston-test-runner.c
tests/weston-test-runner.h

index 2ed1dd44024d33ebfc185230240f12d233406e59..05cafec44e820f73f0a6ae40826a2ff5898fa866 100644 (file)
@@ -79,7 +79,7 @@ input_timestamp(void *data,
        timespec_from_proto(timestamp, tv_sec_hi, tv_sec_lo,
                            tv_nsec);
 
-       fprintf(stderr, "test-client: got input timestamp %ld.%ld\n",
+       testlog("test-client: got input timestamp %ld.%ld\n",
                timestamp->tv_sec, timestamp->tv_nsec);
 }
 
index 1963e77eeeff91030fa57443f9a04e7b39c3ce8f..fb5ed5f8deef9bda825df2db97c3d9294a2650d1 100644 (file)
@@ -76,7 +76,7 @@ TEST(internal_screenshot)
        bool dump_all_images = true;
 
        /* Create the client */
-       printf("Creating client for test\n");
+       testlog("Creating client for test\n");
        client = create_client_and_test_surface(100, 100, 100, 100);
        assert(client);
        surface = client->surface->wl_surface;
@@ -106,19 +106,19 @@ TEST(internal_screenshot)
        wl_surface_commit(surface);
 
        /* Take a snapshot.  Result will be in screenshot->wl_buffer. */
-       printf("Taking a screenshot\n");
+       testlog("Taking a screenshot\n");
        screenshot = capture_screenshot_of_output(client);
        assert(screenshot);
 
        /* Load good reference image */
        fname = screenshot_reference_filename("internal-screenshot-good", 0);
-       printf("Loading good reference image %s\n", fname);
+       testlog("Loading good reference image %s\n", fname);
        reference_good = load_image_from_png(fname);
        assert(reference_good);
 
        /* Load bad reference image */
        fname = screenshot_reference_filename("internal-screenshot-bad", 0);
-       printf("Loading bad reference image %s\n", fname);
+       testlog("Loading bad reference image %s\n", fname);
        reference_bad = load_image_from_png(fname);
        assert(reference_bad);
 
@@ -126,7 +126,7 @@ TEST(internal_screenshot)
         * We expect this to fail since we use a bad reference image
         */
        match = check_images_match(screenshot->image, reference_bad, NULL);
-       printf("Screenshot %s reference image\n", match? "equal to" : "different from");
+       testlog("Screenshot %s reference image\n", match? "equal to" : "different from");
        assert(!match);
        pixman_image_unref(reference_bad);
 
@@ -138,9 +138,9 @@ TEST(internal_screenshot)
        clip.y = 100;
        clip.width = 100;
        clip.height = 100;
-       printf("Clip: %d,%d %d x %d\n", clip.x, clip.y, clip.width, clip.height);
+       testlog("Clip: %d,%d %d x %d\n", clip.x, clip.y, clip.width, clip.height);
        match = check_images_match(screenshot->image, reference_good, &clip);
-       printf("Screenshot %s reference image in clipped area\n", match? "matches" : "doesn't match");
+       testlog("Screenshot %s reference image in clipped area\n", match? "matches" : "doesn't match");
        if (!match) {
                diffimg = visualize_image_difference(screenshot->image, reference_good, &clip);
                fname = screenshot_output_filename("internal-screenshot-error", 0);
@@ -157,6 +157,6 @@ TEST(internal_screenshot)
 
        buffer_destroy(screenshot);
 
-       printf("Test complete\n");
+       testlog("Test complete\n");
        assert(match);
 }
index 520b3978d2b5ed384180524076ce4419dbf797e4..def9482e496fb8c88463f1ebbb06466a0d9f938d 100644 (file)
@@ -99,7 +99,7 @@ runner_destroy(struct runner *runner)
 static void
 runner_run(struct runner *runner, const char *test_name)
 {
-       fprintf(stderr, "weston_test_runner.run(\"%s\")\n", test_name);
+       testlog("weston_test_runner.run(\"%s\")\n", test_name);
 
        runner->done = 0;
        weston_test_runner_run(runner->test_runner, test_name);
index 9fefb5f015a4381992819cbbf82d157ca1c8c9e7..02398b16bd06694ebf21c0072fff9b41f409ef2e 100644 (file)
@@ -68,5 +68,5 @@ TEST(ivi_application_exists)
        iviapp = get_ivi_application(client);
        client_roundtrip(client);
 
-       printf("Successful bind: %p\n", iviapp);
+       testlog("Successful bind: %p\n", iviapp);
 }
index a4f8c87fc501642e62e9c2aed5c56a8fd99331a7..6790ab6638ac2d53362b1f1ab1832a874a83702b 100644 (file)
@@ -188,17 +188,17 @@ feedback_print(struct feedback *fb)
 
        switch (fb->result) {
        case FB_PENDING:
-               printf("pending");
+               testlog("pending");
                return;
        case FB_DISCARDED:
-               printf("discarded");
+               testlog("discarded");
                return;
        case FB_PRESENTED:
                break;
        }
 
        pflags_to_str(fb->flags, str, sizeof str);
-       printf("presented %lld.%09lld, refresh %u us, [%s] seq %" PRIu64,
+       testlog("presented %lld.%09lld, refresh %u us, [%s] seq %" PRIu64,
                (long long)fb->time.tv_sec, (long long)fb->time.tv_nsec,
                fb->refresh_nsec / 1000, str, fb->seq);
 }
@@ -230,9 +230,9 @@ TEST(test_presentation_feedback_simple)
 
        feedback_wait(fb);
 
-       printf("%s feedback:", __func__);
+       testlog("%s feedback:", __func__);
        feedback_print(fb);
-       printf("\n");
+       testlog("\n");
 
        feedback_destroy(fb);
 }
index a8bf53a367eed5433e49d25b47b05ea1bb931e62..d3dc05baddf07f219156124be465d5e7feb6bcbb 100644 (file)
@@ -144,8 +144,8 @@ check_screen(struct client *client,
        assert(shot);
 
        match = check_images_match(shot->image, ref, clip);
-       printf("ref %s vs. shot %s: %s\n", ref_fname, shot_fname,
-              match ? "PASS" : "FAIL");
+       testlog("ref %s vs. shot %s: %s\n", ref_fname, shot_fname,
+               match ? "PASS" : "FAIL");
 
        write_image_as_png(shot->image, shot_fname);
        if (!match)
index 1a24ee3515a4dee1e19a555235c6738f1173a7f0..cdf71a194ad81596acefc1affec68d53a32eeff0 100644 (file)
@@ -694,11 +694,11 @@ destroy_permu_object(struct wl_surface **surfs,
        int h = (i + 1) / 2;
 
        if (i & 1) {
-               fprintf(stderr, " [sub  %2d]", h);
+               testlog(" [sub  %2d]", h);
                wl_subsurface_destroy(subs[h]);
                subs[h] = NULL;
        } else {
-               fprintf(stderr, " [surf %2d]", h);
+               testlog(" [surf %2d]", h);
                wl_surface_destroy(surfs[h]);
                surfs[h] = NULL;
        }
@@ -736,15 +736,15 @@ TEST(test_subsurface_destroy_permutations)
 
                create_subsurface_tree(client, surfs, subs, test_size);
 
-               fprintf(stderr, "permu");
+               testlog("permu");
 
                for (i = 0; i < NSTEPS; i++)
-                       fprintf(stderr, " %2d", per.cnt[i]);
+                       testlog(" %2d", per.cnt[i]);
 
                for (i = 0; i < NSTEPS; i++)
                        destroy_permu_object(surfs, subs, per.cnt[i]);
 
-               fprintf(stderr, "\n");
+               testlog("\n");
                client_roundtrip(client);
 
                destroy_subsurface_tree(surfs, subs, test_size);
@@ -752,5 +752,5 @@ TEST(test_subsurface_destroy_permutations)
        }
 
        client_roundtrip(client);
-       fprintf(stderr, "tried %d destroy permutations\n", counter);
+       testlog("tried %d destroy permutations\n", counter);
 }
index 685a28dca8b58173ba540686db588daa8bf8643a..0436f9b64f32c74ef492da106368e0d4d3faa113 100644 (file)
@@ -112,7 +112,7 @@ text_input_enter(void *data,
 {
        struct text_input_state *state = data;
 
-       fprintf(stderr, "%s\n", __FUNCTION__);
+       testlog("%s\n", __FUNCTION__);
 
        state->activated += 1;
 }
index f9b19d9e10a568e04284b802d403b1d6822065d2..2dd6be4c8ee8f8daa9fd776ad5addc3c901f0884 100644 (file)
@@ -125,7 +125,7 @@ TEST_P(test_viewporter_bad_source_rect, bad_source_rect_args)
 
        vp = create_viewport(client);
 
-       fprintf(stderr, "wp_viewport.set_source x=%d, y=%d, w=%d, h=%d\n",
+       testlog("wp_viewport.set_source x=%d, y=%d, w=%d, h=%d\n",
                args->x, args->y, args->w, args->h);
        set_source(vp, args->x, args->y, args->w, args->h);
 
@@ -170,8 +170,7 @@ TEST_P(test_viewporter_bad_destination_size, bad_destination_args)
 
        vp = create_viewport(client);
 
-       fprintf(stderr, "wp_viewport.set_destination w=%d, h=%d\n",
-               args->w, args->h);
+       testlog("wp_viewport.set_destination w=%d, h=%d\n", args->w, args->h);
        wp_viewport_set_destination(vp, args->w, args->h);
 
        expect_protocol_error(client, &wp_viewport_interface,
@@ -216,7 +215,7 @@ TEST_P(test_viewporter_non_integer_destination_size, nonint_destination_args)
 
        vp = create_viewport(client);
 
-       fprintf(stderr, "non-integer size w=%f, h=%f\n",
+       testlog("non-integer size w=%f, h=%f\n",
                wl_fixed_to_double(args->w), wl_fixed_to_double(args->h));
        wp_viewport_set_source(vp, 5, 6, args->w, args->h);
        wp_viewport_set_destination(vp, -1, -1);
@@ -285,12 +284,12 @@ setup_source_vs_buffer(struct client *client,
        surf = client->surface->wl_surface;
        vp = create_viewport(client);
 
-       fprintf(stderr, "surface %dx%d\n",
+       testlog("surface %dx%d\n",
                get_surface_width(client->surface,
                                  args->buffer_scale, args->buffer_transform),
                get_surface_height(client->surface,
                                   args->buffer_scale, args->buffer_transform));
-       fprintf(stderr, "source x=%f, y=%f, w=%f, h=%f; "
+       testlog("source x=%f, y=%f, w=%f, h=%f; "
                "buffer scale=%d, transform=%d\n",
                wl_fixed_to_double(args->x), wl_fixed_to_double(args->y),
                wl_fixed_to_double(args->w), wl_fixed_to_double(args->h),
index 5523844c742bb915a30552a432878cded24e7415..503ed0983e247efd168ff2462c36a2c2418869fc 100644 (file)
@@ -130,7 +130,7 @@ pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
        pointer->x = wl_fixed_to_int(x);
        pointer->y = wl_fixed_to_int(y);
 
-       fprintf(stderr, "test-client: got pointer enter %d %d, surface %p\n",
+       testlog("test-client: got pointer enter %d %d, surface %p\n",
                pointer->x, pointer->y, pointer->focus);
 }
 
@@ -142,7 +142,7 @@ pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
 
        pointer->focus = NULL;
 
-       fprintf(stderr, "test-client: got pointer leave, surface %p\n",
+       testlog("test-client: got pointer leave, surface %p\n",
                wl_surface ? wl_surface_get_user_data(wl_surface) : NULL);
 }
 
@@ -158,7 +158,7 @@ pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
        pointer->motion_time_timespec = pointer->input_timestamp;
        pointer->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got pointer motion %d %d\n",
+       testlog("test-client: got pointer motion %d %d\n",
                pointer->x, pointer->y);
 }
 
@@ -175,8 +175,7 @@ pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
        pointer->button_time_timespec = pointer->input_timestamp;
        pointer->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got pointer button %u %u\n",
-               button, state);
+       testlog("test-client: got pointer button %u %u\n", button, state);
 }
 
 static void
@@ -191,21 +190,21 @@ pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
        pointer->axis_time_timespec = pointer->input_timestamp;
        pointer->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got pointer axis %u %f\n",
+       testlog("test-client: got pointer axis %u %f\n",
                axis, wl_fixed_to_double(value));
 }
 
 static void
 pointer_handle_frame(void *data, struct wl_pointer *wl_pointer)
 {
-       fprintf(stderr, "test-client: got pointer frame\n");
+       testlog("test-client: got pointer frame\n");
 }
 
 static void
 pointer_handle_axis_source(void *data, struct wl_pointer *wl_pointer,
                             uint32_t source)
 {
-       fprintf(stderr, "test-client: got pointer axis source %u\n", source);
+       testlog("test-client: got pointer axis source %u\n", source);
 }
 
 static void
@@ -219,15 +218,14 @@ pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer,
        pointer->axis_stop_time_timespec = pointer->input_timestamp;
        pointer->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got pointer axis stop %u\n", axis);
+       testlog("test-client: got pointer axis stop %u\n", axis);
 }
 
 static void
 pointer_handle_axis_discrete(void *data, struct wl_pointer *wl_pointer,
                             uint32_t axis, int32_t value)
 {
-       fprintf(stderr, "test-client: got pointer axis discrete %u %d\n",
-               axis, value);
+       testlog("test-client: got pointer axis discrete %u %d\n", axis, value);
 }
 
 static const struct wl_pointer_listener pointer_listener = {
@@ -248,7 +246,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard,
 {
        close(fd);
 
-       fprintf(stderr, "test-client: got keyboard keymap\n");
+       testlog("test-client: got keyboard keymap\n");
 }
 
 static void
@@ -263,7 +261,7 @@ keyboard_handle_enter(void *data, struct wl_keyboard *wl_keyboard,
        else
                keyboard->focus = NULL;
 
-       fprintf(stderr, "test-client: got keyboard enter, surface %p\n",
+       testlog("test-client: got keyboard enter, surface %p\n",
                keyboard->focus);
 }
 
@@ -275,7 +273,7 @@ keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard,
 
        keyboard->focus = NULL;
 
-       fprintf(stderr, "test-client: got keyboard leave, surface %p\n",
+       testlog("test-client: got keyboard leave, surface %p\n",
                wl_surface ? wl_surface_get_user_data(wl_surface) : NULL);
 }
 
@@ -292,7 +290,7 @@ keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard,
        keyboard->key_time_timespec = keyboard->input_timestamp;
        keyboard->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got keyboard key %u %u\n", key, state);
+       testlog("test-client: got keyboard key %u %u\n", key, state);
 }
 
 static void
@@ -308,7 +306,7 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard,
        keyboard->mods_locked = mods_locked;
        keyboard->group = group;
 
-       fprintf(stderr, "test-client: got keyboard modifiers %u %u %u %u\n",
+       testlog("test-client: got keyboard modifiers %u %u %u %u\n",
                mods_depressed, mods_latched, mods_locked, group);
 }
 
@@ -321,8 +319,7 @@ keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard,
        keyboard->repeat_info.rate = rate;
        keyboard->repeat_info.delay = delay;
 
-       fprintf(stderr, "test-client: got keyboard repeat_info %d %d\n",
-               rate, delay);
+       testlog("test-client: got keyboard repeat_info %d %d\n", rate, delay);
 }
 
 static const struct wl_keyboard_listener keyboard_listener = {
@@ -349,7 +346,7 @@ touch_handle_down(void *data, struct wl_touch *wl_touch,
        touch->down_time_timespec = touch->input_timestamp;
        touch->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got touch down %d %d, surf: %p, id: %d\n",
+       testlog("test-client: got touch down %d %d, surf: %p, id: %d\n",
                touch->down_x, touch->down_y, surface, id);
 }
 
@@ -363,7 +360,7 @@ touch_handle_up(void *data, struct wl_touch *wl_touch,
        touch->up_time_timespec = touch->input_timestamp;
        touch->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got touch up, id: %d\n", id);
+       testlog("test-client: got touch up, id: %d\n", id);
 }
 
 static void
@@ -378,7 +375,7 @@ touch_handle_motion(void *data, struct wl_touch *wl_touch,
        touch->motion_time_timespec = touch->input_timestamp;
        touch->input_timestamp = (struct timespec) { 0 };
 
-       fprintf(stderr, "test-client: got touch motion, %d %d, id: %d\n",
+       testlog("test-client: got touch motion, %d %d, id: %d\n",
                touch->x, touch->y, id);
 }
 
@@ -389,7 +386,7 @@ touch_handle_frame(void *data, struct wl_touch *wl_touch)
 
        ++touch->frame_no;
 
-       fprintf(stderr, "test-client: got touch frame (%d)\n", touch->frame_no);
+       testlog("test-client: got touch frame (%d)\n", touch->frame_no);
 }
 
 static void
@@ -399,7 +396,7 @@ touch_handle_cancel(void *data, struct wl_touch *wl_touch)
 
        ++touch->cancel_no;
 
-       fprintf(stderr, "test-client: got touch cancel (%d)\n", touch->cancel_no);
+       testlog("test-client: got touch cancel (%d)\n", touch->cancel_no);
 }
 
 static const struct wl_touch_listener touch_listener = {
@@ -418,8 +415,7 @@ surface_enter(void *data,
 
        surface->output = wl_output_get_user_data(output);
 
-       fprintf(stderr, "test-client: got surface enter output %p\n",
-               surface->output);
+       testlog("test-client: got surface enter output %p\n", surface->output);
 }
 
 static void
@@ -430,7 +426,7 @@ surface_leave(void *data,
 
        surface->output = NULL;
 
-       fprintf(stderr, "test-client: got surface leave output %p\n",
+       testlog("test-client: got surface leave output %p\n",
                wl_output_get_user_data(output));
 }
 
@@ -536,7 +532,7 @@ test_handle_pointer_position(void *data, struct weston_test *weston_test,
        test->pointer_x = wl_fixed_to_int(x);
        test->pointer_y = wl_fixed_to_int(y);
 
-       fprintf(stderr, "test-client: got global pointer %d %d\n",
+       testlog("test-client: got global pointer %d %d\n",
                test->pointer_x, test->pointer_y);
 }
 
@@ -545,7 +541,7 @@ test_handle_capture_screenshot_done(void *data, struct weston_test *weston_test)
 {
        struct test *test = data;
 
-       printf("Screenshot has been captured\n");
+       testlog("Screenshot has been captured\n");
        test->buffer_copy_done = 1;
 }
 
@@ -639,8 +635,7 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
        if (input->seat_name && strcmp(input->seat_name, "test-seat") == 0)
                input_update_devices(input);
 
-       fprintf(stderr, "test-client: got seat %p capabilities: %x\n",
-               input, caps);
+       testlog("test-client: got seat %p capabilities: %x\n", input, caps);
 }
 
 static void
@@ -660,8 +655,7 @@ seat_handle_name(void *data, struct wl_seat *seat, const char *name)
                input->client->input = input;
        }
 
-       fprintf(stderr, "test-client: got seat %p name: \'%s\'\n",
-               input, name);
+       testlog("test-client: got seat %p name: \'%s\'\n", input, name);
 }
 
 static const struct wl_seat_listener seat_listener = {
@@ -877,8 +871,7 @@ expect_protocol_error(struct client *client,
 
        /* check error */
        if (errcode != code) {
-               fprintf(stderr, "Should get error code %d but got %d\n",
-                       code, errcode);
+               testlog("Should get error code %d but got %d\n", code, errcode);
                failed = 1;
        }
 
@@ -886,19 +879,19 @@ expect_protocol_error(struct client *client,
        assert(interface);
 
        if (strcmp(intf->name, interface->name) != 0) {
-               fprintf(stderr, "Should get interface '%s' but got '%s'\n",
+               testlog("Should get interface '%s' but got '%s'\n",
                        intf->name, interface->name);
                failed = 1;
        }
 
        if (failed) {
-               fprintf(stderr, "Expected other protocol error\n");
+               testlog("Expected other protocol error\n");
                abort();
        }
 
        /* all OK */
-       fprintf(stderr, "Got expected protocol error on '%s' (object id: %d) "
-                       "with code %d\n", interface->name, id, errcode);
+       testlog("Got expected protocol error on '%s' (object id: %d) "
+               "with code %d\n", interface->name, id, errcode);
 }
 
 static void
@@ -1337,7 +1330,7 @@ write_image_as_png(pixman_image_t *image, const char *fname)
 
        status = cairo_surface_write_to_png(cairo_surface, fname);
        if (status != CAIRO_STATUS_SUCCESS) {
-               fprintf(stderr, "Failed to save image '%s': %s\n", fname,
+               testlog("Failed to save image '%s': %s\n", fname,
                        cairo_status_to_string(status));
 
                return false;
@@ -1407,7 +1400,8 @@ load_image_from_png(const char *fname)
        cairo_surface_flush(reference_cairo_surface);
        status = cairo_surface_status(reference_cairo_surface);
        if (status != CAIRO_STATUS_SUCCESS) {
-               printf("Could not open %s: %s\n", fname, cairo_status_to_string(status));
+               testlog("Could not open %s: %s\n", fname,
+                       cairo_status_to_string(status));
                cairo_surface_destroy(reference_cairo_surface);
                return NULL;
        }
index 9dbe43e30ebf099c98189125b97fc0a5a66830e0..c269b69fae206a0b950b0333dd23ce41acf96f73 100644 (file)
@@ -50,6 +50,16 @@ get_test_name(void)
        return test_name_;
 }
 
+void
+testlog(const char *fmt, ...)
+{
+       va_list argp;
+
+       va_start(argp, fmt);
+       vfprintf(stderr, fmt, argp);
+       va_end(argp);
+}
+
 static const struct weston_test *
 find_test(const char *name)
 {
index eb9a488a1864b40422e246e97a87b8e66d50ac7e..31c15848a0e3627ee3dfe8c6fd76ee4890326be4 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <stdlib.h>
 
+#include <wayland-util.h>
 #include "shared/helpers.h"
 
 #ifdef NDEBUG
@@ -80,6 +81,9 @@ struct weston_test {
 #define TEST_P(name, data) ARG_TEST(name, 0, data)
 #define FAIL_TEST_P(name, data) ARG_TEST(name, 1, data)
 
+void
+testlog(const char *fmt, ...) WL_PRINTF(1, 2);
+
 /**
  * Get the test name string with counter
  *