summaryrefslogtreecommitdiff
path: root/unittest/mytap
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-11-25 00:57:34 +0200
committerMichael Widenius <monty@askmonty.org>2010-11-25 00:57:34 +0200
commit1a6373e8e2f0c8c5ca6b8ef5076dcb2948eeb41a (patch)
treeff2e875015b39ca3c66eba19d145dd014d4e768e /unittest/mytap
parentb16c389248d03f0c3de549884f607f3f191827b4 (diff)
parent5e100a64b51aa2dd09a9a1679413fa03797a95a2 (diff)
downloadmariadb-git-1a6373e8e2f0c8c5ca6b8ef5076dcb2948eeb41a.tar.gz
Merge with MySQL 5.1.53
Open issues: - A better fix for #57688; Igor is working on this - Test failure in index_merge_innodb.test ; Igor promised to look at this - Some Innodb tests fails (need to merge with latest xtradb) ; Kristian promised to look at this. - Failing tests: innodb_plugin.innodb_bug56143 innodb_plugin.innodb_bug56632 innodb_plugin.innodb_bug56680 innodb_plugin.innodb_bug57255 - Werror is disabled; Should be enabled after merge with xtradb.
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 2f1747d7167..550920d9d3e 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 a75d0a4932b..ee04f7dc049 100644
--- a/unittest/mytap/tap.h
+++ b/unittest/mytap/tap.h
@@ -121,8 +121,8 @@ void plan(int 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 pass, char const *fmt, ...)
@@ -130,6 +130,17 @@ void ok(int 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.