diff options
Diffstat (limited to 'test/main.c')
| -rw-r--r-- | test/main.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/main.c b/test/main.c index 8102a58..68241f9 100644 --- a/test/main.c +++ b/test/main.c @@ -1,7 +1,10 @@ #include <locale.h> #include <signal.h> +#include <stdint.h> #include <stdlib.h> +#include <time.h> +#include "bits/time.h" #include "test.h" void handle_abort() { exit(1); } @@ -10,6 +13,9 @@ int main() { setlocale(LC_ALL, ""); signal(SIGABRT, handle_abort); + struct timespec test_begin; + clock_gettime(CLOCK_MONOTONIC, &test_begin); + printf("\nš \x1b[1;36mRunning utf8 tests...\x1b[0m\n"); run_utf8_tests(); @@ -22,6 +28,15 @@ int main() { printf("\nš \x1b[1;36mRunning command tests...\x1b[0m\n"); run_command_tests(); - printf("\nš \x1b[1;32mDone! All tests successful!\x1b[0m\n"); + printf("\nš \x1b[1;36mRunning keyboard tests...\x1b[0m\n"); + run_keyboard_tests(); + + struct timespec elapsed; + clock_gettime(CLOCK_MONOTONIC, &elapsed); + uint64_t elapsed_nanos = + ((uint64_t)elapsed.tv_sec * 1e9 + (uint64_t)elapsed.tv_nsec) - + ((uint64_t)test_begin.tv_sec * 1e9 + (uint64_t)test_begin.tv_nsec); + printf("\nš \x1b[1;32mDone! All tests successful in %.2f ms!\x1b[0m\n", + (double)elapsed_nanos / 1e6); return 0; } |
