-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci_check.sh
More file actions
87 lines (78 loc) · 2.29 KB
/
Copy pathci_check.sh
File metadata and controls
87 lines (78 loc) · 2.29 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
# Replicates what CI does: compile everything with -Wall -Wextra -Wpedantic
# and run the test binary. Errors here == CI errors.
set -e
ROOT=/mnt/c/Users/Arjun/Desktop/UMR
OUT=/tmp/umr_ci_check
mkdir -p "$OUT"
SRCS=(
"$ROOT/core/runtime.c"
"$ROOT/core/policy.c"
"$ROOT/core/tls_heap.c"
"$ROOT/core/alloc_manager.c"
"$ROOT/allocator/general_allocator.c"
"$ROOT/allocator/arena.c"
"$ROOT/allocator/pool.c"
"$ROOT/allocator/slab.c"
"$ROOT/allocator/buddy.c"
"$ROOT/fragment/fragment_manager.c"
"$ROOT/fragment/block_split.c"
"$ROOT/fragment/block_merge.c"
"$ROOT/heap/heap_manager.c"
"$ROOT/heap/metadata.c"
"$ROOT/debug/sanitizer.c"
"$ROOT/debug/quarantine.c"
"$ROOT/debug/guard_pages.c"
"$ROOT/profiler/statistics.c"
"$ROOT/profiler/tracker.c"
"$ROOT/profiler/leak_detector.c"
"$ROOT/profiler/heap_viz.c"
"$ROOT/profiler/snapshot.c"
"$ROOT/platform/linux.c"
)
TEST_SRCS=(
"$ROOT/tests/test_main.c"
"$ROOT/tests/test_alloc.c"
"$ROOT/tests/test_realloc.c"
"$ROOT/tests/test_stress.c"
"$ROOT/tests/test_platform.c"
"$ROOT/tests/test_arena.c"
"$ROOT/tests/test_pool.c"
"$ROOT/tests/test_slab.c"
"$ROOT/tests/test_buddy.c"
"$ROOT/tests/test_tracker.c"
"$ROOT/tests/test_viz.c"
"$ROOT/tests/test_fragment.c"
"$ROOT/tests/test_threads.c"
)
EXAMPLE_SRCS=(
"$ROOT/examples/basic.c"
"$ROOT/examples/arena_example.c"
"$ROOT/examples/pool_example.c"
"$ROOT/examples/slab_example.c"
"$ROOT/examples/buddy_example.c"
"$ROOT/examples/leak_example.c"
"$ROOT/examples/viz_example.c"
"$ROOT/examples/fragment_example.c"
"$ROOT/examples/game_frame_arena.c"
"$ROOT/examples/enemy_pool.c"
"$ROOT/examples/server_request_arena.c"
)
FLAGS="-std=c11 -O2 -Wall -Wextra -Wpedantic -DUMR_STATIC -I$ROOT/include -I$ROOT/tests"
echo "====== [1/3] Building library + tests ======"
gcc $FLAGS "${SRCS[@]}" "${TEST_SRCS[@]}" -o "$OUT/umr_tests" -lpthread 2>&1
echo "Build OK"
echo ""
echo "====== [2/3] Running tests ======"
"$OUT/umr_tests" 2>&1
echo "Tests OK"
echo ""
echo "====== [3/3] Building examples (compile check) ======"
for src in "${EXAMPLE_SRCS[@]}"; do
name=$(basename "$src" .c)
echo -n " $name ... "
gcc $FLAGS "${SRCS[@]}" "$src" -o "$OUT/$name" -lpthread 2>&1
echo "OK"
done
echo ""
echo "====== ALL CHECKS PASSED ======"