From 78333b70c017eac3f553d2b194a55e3398b68eb3 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 6 Jul 2017 10:22:14 -0700 Subject: [PATCH] Build benchmarks with scan-build on CI --- script/benchmark | 14 ++++++++++++-- script/ci | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/script/benchmark b/script/benchmark index 8fa65326..75b137ed 100755 --- a/script/benchmark +++ b/script/benchmark @@ -20,6 +20,8 @@ OPTIONS -L run benchmarks with parse logging turned on + -b run make under the scan-build static analyzer + EOF } @@ -30,8 +32,9 @@ fi mode=normal export BUILDTYPE=Test cmd=out/Test/benchmarks +run_scan_build= -while getopts "dhf:l:SL" option; do +while getopts "bdhf:l:SL" option; do case ${option} in h) usage @@ -49,10 +52,17 @@ while getopts "dhf:l:SL" option; do L) export TREE_SITTER_BENCHMARK_LOG=1 ;; + b) + run_scan_build=true + ;; esac done -make -j2 benchmarks +if [[ -n "$run_scan_build" ]]; then + scan_build make -j2 $target +else + make -j2 benchmarks +fi case $mode in debug) diff --git a/script/ci b/script/ci index 6ada80e9..5360ccb5 100755 --- a/script/ci +++ b/script/ci @@ -7,4 +7,4 @@ set -e script/fetch-fixtures script/check-mallocs script/test -b -script/benchmark +script/benchmark -b