-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.sh
executable file
·79 lines (64 loc) · 1.95 KB
/
validate.sh
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
#!/usr/bin/env bash
# Force the script to exit when it encounters a non-0 return value
set -e
function print_success() {
echo -en "\033[32m"
echo $1
echo -en "\033[0m"
}
function print_error() {
echo -en "\033[31m"
echo $1
echo -en "\033[0m"
}
function test_build() {
make -B $1 --jobs=8
print_success "$1 Success"
}
# Clear the screen so results don't get confused between runs
clear
print_success "Generating Compilation Database"
make comp-db > /dev/null
print_success "Compilation Database Created"
# Validate that all formatting conforms to the style specified in .clang-format
./validate_format.py -r \
--exclude src/hashing/include/farmhash.c \
src
print_success "Format Check Passed"
# make lint
cpplint src/*.c
cpplint src/list_data_structures/*.[ch]
cpplint src/data_structures/*.[ch]
cpplint src/hashing/*.[ch]
cpplint src/cache/*.[ch]
cpplint src/sorting/*.[ch]
cpplint src/quick_select/*.[ch]
cpplint src/matrix_operations/*.[ch]
cpplint src/running_median/*.[ch]
cpplint src/closest_pair/*.[ch]
cpplint src/inversion_count/*.[ch]
cpplint locality/*.[ch]
print_success "Lint Passed"
# make tidy
clang-tidy src/test_runner.c
clang-tidy src/list_data_structures/*.[ch]
clang-tidy src/data_structures/*.[ch]
clang-tidy src/hashing/*.[ch]
clang-tidy src/cache/*.[ch]
clang-tidy src/sorting/*.[ch]
clang-tidy src/quick_select/*.[ch]
clang-tidy src/matrix_operations/*.[ch]
clang-tidy src/running_median/*.[ch]
clang-tidy src/closest_pair/*.[ch]
clang-tidy src/inversion_count/*.[ch]
clang-tidy locality/*.[ch]
print_success "Tidy Static Analysis Passed"
# Build with undefined and address clang sanitizers and run all tests
test_build address-san
# Build with undefined and memory clang sanitizers and run all tests
test_build memory-san
# Build with undefined and thread clang sanitizers and run all tests
test_build thread-san
# Build with no sanitizers and max optimization level (O3) and run all tests
test_build release
print_success "Build Passed"