mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-08 16:20:33 +01:00
Merge branch 'tap-skip' into 'master'
test: Avoid misleading diagnostic when some tests are skipped Closes #363 See merge request dbus/dbus!241
This commit is contained in:
commit
edc0134b10
1 changed files with 8 additions and 2 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
static unsigned int failures = 0;
|
||||
static unsigned int skipped = 0;
|
||||
static unsigned int tap_test_counter = 0;
|
||||
|
||||
/*
|
||||
|
|
@ -148,6 +149,7 @@ _dbus_test_skip (const char *format,
|
|||
va_list ap;
|
||||
|
||||
printf ("ok %u # SKIP ", ++tap_test_counter);
|
||||
++skipped;
|
||||
va_start (ap, format);
|
||||
vprintf (format, ap);
|
||||
va_end (ap);
|
||||
|
|
@ -194,10 +196,14 @@ _dbus_test_check_memleaks (const char *test_name)
|
|||
int
|
||||
_dbus_test_done_testing (void)
|
||||
{
|
||||
_dbus_assert (skipped <= tap_test_counter);
|
||||
|
||||
if (failures == 0)
|
||||
_dbus_test_diag ("%u tests passed", tap_test_counter);
|
||||
_dbus_test_diag ("%u tests passed (%d skipped)",
|
||||
tap_test_counter - skipped, skipped);
|
||||
else
|
||||
_dbus_test_diag ("%u/%u tests failed", failures, tap_test_counter);
|
||||
_dbus_test_diag ("%u/%u tests failed (%d skipped)",
|
||||
failures, tap_test_counter - skipped, skipped);
|
||||
|
||||
printf ("1..%u\n", tap_test_counter);
|
||||
fflush (stdout);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue