blob: 7663f8f829706889c59049231c92e2bb5a2714ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include <locale.h>
#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include "test.h"
void handle_abort() { exit(1); }
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();
printf("\nš \x1b[1;36mRunning text tests...\x1b[0m\n");
run_text_tests();
printf("\nš“ļø \x1b[1;36mRunning buffer tests...\x1b[0m\n");
run_buffer_tests();
printf("\nš \x1b[1;36mRunning command tests...\x1b[0m\n");
run_command_tests();
printf("\nš \x1b[1;36mRunning keyboard tests...\x1b[0m\n");
run_keyboard_tests();
printf("\nš¾ \x1b[1;36mRunning allocator tests...\x1b[0m\n");
run_allocator_tests();
printf("\nš \x1b[1;36mRunning minibuffer tests...\x1b[0m\n");
run_minibuffer_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;
}
|