summaryrefslogtreecommitdiff
path: root/unittest/mysys
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-05-05 14:51:01 +0300
committerMichael Widenius <monty@askmonty.org>2011-05-05 14:51:01 +0300
commitd5caa00161453eb0cd61e3641d4e6783fb385319 (patch)
tree34c7e24c19fda340a460e8d5316ca054617c687d /unittest/mysys
parenta67a5dd6f956bf6f62799eafa2c67d008ee15e24 (diff)
downloadmariadb-git-d5caa00161453eb0cd61e3641d4e6783fb385319.tar.gz
Improved 'make test-unit' time slightly
storage/maria/unittest/ma_test_loghandler-t.c: Don't sync during test storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Don't sync during test storage/maria/unittest/ma_test_loghandler_multithread-t.c: Don't sync during test unittest/mysys/bitmap-t.c: Don't test all bit combinations (not needed) unittest/mysys/thr_template.c: Remove sleep as old bug should be fixed nowadays unittest/mysys/waiting_threads-t.c: Only run test with --big unittest/mytap/tap.c: Print total time at end of test. unittest/unit.pl: Use TAP::Harness instead of Test::Harness (recommended according to manual) Add times to tests.
Diffstat (limited to 'unittest/mysys')
-rw-r--r--unittest/mysys/bitmap-t.c10
-rw-r--r--unittest/mysys/thr_template.c4
-rw-r--r--unittest/mysys/waiting_threads-t.c5
3 files changed, 16 insertions, 3 deletions
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index 9fca9f8ef20..2065e10b53f 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -526,8 +526,14 @@ int main()
int const max_size = MAX_TESTED_BITMAP_SIZE;
MY_INIT("bitmap-t");
- plan(max_size - min_size);
- for (i= min_size; i < max_size; i++)
+ plan((max_size - min_size)/7+1);
+
+ /*
+ It's ok to do steps in 7, as i module 64 will go trough all values 1..63.
+ Any errors in the code should manifest as we are working with integers
+ of size 16, 32, or 64 bits...
+ */
+ for (i= min_size; i < max_size; i+=7)
ok(do_test(i) == 0, "bitmap size %d", i);
return exit_status();
}
diff --git a/unittest/mysys/thr_template.c b/unittest/mysys/thr_template.c
index 1ac03e474fd..e6af1fb12e2 100644
--- a/unittest/mysys/thr_template.c
+++ b/unittest/mysys/thr_template.c
@@ -82,7 +82,9 @@ int main(int argc __attribute__((unused)), char **argv)
workaround until we know why it crashes randomly on some machine
(BUG#22320).
*/
- sleep(2);
+#ifdef NOT_USED
+ sleep(1);
+#endif
pthread_mutex_destroy(&mutex);
pthread_cond_destroy(&cond);
pthread_attr_destroy(&thr_attr);
diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c
index e32a83ef172..7bb5b2038fb 100644
--- a/unittest/mysys/waiting_threads-t.c
+++ b/unittest/mysys/waiting_threads-t.c
@@ -181,6 +181,11 @@ void do_one_test()
void do_tests()
{
DBUG_ENTER("do_tests");
+ if (skip_big_tests)
+ {
+ skip(1, "Big test skipped");
+ return;
+ }
plan(14);
compile_time_assert(THREADS >= 4);