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