-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.sh
More file actions
executable file
·44 lines (37 loc) · 1.26 KB
/
check.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.26 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
#!/bin/bash -x
function splitline {
echo "-----------------"
}
# echo "Batch Clone Build Test"
# if ! go test -v ./cmd/batch_clone_build; then
# echo "Batch Clone Build Test Failed"
# exit 1
# fi
# splitline
# echo "Escape Adapter Test"
# if ! go test -v ./cmd/escape_adapter; then
# echo "Escape Adapter Test Failed"
# exit 1
# fi
splitline
echo "External Verify Test"
go run ./cmd/batch_clone_build yaml-examples/malloc_test.yaml
# check number of lines in pprof ext csv file is equal to count of CodeQL class instances
if ! go run ./cmd/pprof-external-verify codeql-db/test/malloc_test/ instance_count ; then
echo "External Verify Test for malloc_test Failed"
exit 1
fi
go run ./cmd/codeql_qdriver -collect yaml-examples/malloc_test.yaml
# check mallocgc time is mapped to CodeQL class instances
MALLOC_CSV="codeqlResult/pprof_ext/malloc_time/malloc_test.csv"
if [ ! -f "$MALLOC_CSV" ]; then
echo "External Verify Test for mallocgc time mapping Failed: $MALLOC_CSV does not exist. Check if the query ran correctly."
exit 1
fi
if [ "$(grep -c . "$MALLOC_CSV")" -ne 2 ]; then
echo "External Verify Test for mallocgc time mapping Failed"
echo "The content of mallocgc time csv file is:"
cat "$MALLOC_CSV"
exit 1
fi
echo "Done!"