summaryrefslogtreecommitdiff
path: root/unittest/mytap
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-10-20 12:48:19 -0200
committerDavi Arnaut <davi.arnaut@oracle.com>2010-10-20 12:48:19 -0200
commit785bcc173de480cde88081c9b054ee8de72cd1ad (patch)
tree8a7eb61812d8e109fee0ee56d3628ea17b919f61 /unittest/mytap
parent7af5094208edac1dd3af9ba2883f3c91264fbf6a (diff)
parentb5bb13ec0380624c2e663a4e9b4b29fe574b3e05 (diff)
downloadmariadb-git-785bcc173de480cde88081c9b054ee8de72cd1ad.tar.gz
Merge of mysql-5.1-bugteam into mysql-5.5-bugteam.
Diffstat (limited to 'unittest/mytap')
-rw-r--r--unittest/mytap/t/basic-t.c2
-rw-r--r--unittest/mytap/tap.c17
-rw-r--r--unittest/mytap/tap.h15
3 files changed, 31 insertions, 3 deletions
diff --git a/unittest/mytap/t/basic-t.c b/unittest/mytap/t/basic-t.c
index c0ceb5bf190..b588521d192 100644
--- a/unittest/mytap/t/basic-t.c
+++ b/unittest/mytap/t/basic-t.c
@@ -22,7 +22,7 @@ int main() {
plan(5);
ok(1 == 1, "testing basic functions");
ok(2 == 2, " ");
- ok(3 == 3, NULL);
+ ok1(3 == 3);
if (1 == 1)
skip(2, "Sensa fragoli");
else {
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 7facb23e7e3..f7a6d881421 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -244,6 +244,23 @@ ok(int pass, char const *fmt, ...)
emit_endl();
}
+void
+ok1(int const pass)
+{
+ va_list ap;
+
+ memset(&ap, 0, sizeof(ap));
+
+ if (!pass && *g_test.todo == '\0')
+ ++g_test.failed;
+
+ vemit_tap(pass, NULL, ap);
+
+ if (*g_test.todo != '\0')
+ emit_dir("todo", g_test.todo);
+
+ emit_endl();
+}
void
skip(int how_many, char const *fmt, ...)
diff --git a/unittest/mytap/tap.h b/unittest/mytap/tap.h
index 1f6edfbba07..60d39c42441 100644
--- a/unittest/mytap/tap.h
+++ b/unittest/mytap/tap.h
@@ -121,8 +121,8 @@ void plan(int const count);
@endcode
@param pass Zero if the test failed, non-zero if it passed.
- @param fmt Format string in printf() format. NULL is allowed, in
- which case nothing is printed.
+ @param fmt Format string in printf() format. NULL is not allowed,
+ use ok1() in this case.
*/
void ok(int const pass, char const *fmt, ...)
@@ -130,6 +130,17 @@ void ok(int const pass, char const *fmt, ...)
/**
+ Report test result as a TAP line.
+
+ Same as ok() but does not take a message to be printed.
+
+ @param pass Zero if the test failed, non-zero if it passed.
+*/
+
+void ok1(int const pass);
+
+
+/**
Skip a determined number of tests.
Function to print that <em>how_many</em> tests have been skipped.