diff --git a/Makefile b/Makefile index 785d1252..cc75bf7e 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,21 @@ test: compile_test_files: pushd test/artificial_samples \ && docker build -t cross_compiling . \ - && docker run --rm -v $(pwd)/build:/home/cwe/artificial_samples/build cross_compiling sudo /home/cwe/.local/bin/scons \ + && rm -rf build/* \ + && mkdir -p build/ \ + && docker run --rm -v $(shell pwd)/test/artificial_samples/build:/home/cwe/artificial_samples/build cross_compiling sudo /usr/local/bin/scons \ && popd \ && pushd test/lkm_samples \ && ./build.sh -codestyle-check: +bench: + if [ ! -d "src/cwe_checker_lib/benches/_data/" ]; then \ + echo "Benchmark binaries not found. Please see src/cwe_checker_lib/benches/benchmarks.rs for instructions."; \ + exit -1; \ + fi + cargo bench --bench "benchmarks" -- --save-baseline __last_make_run + +check: cargo fmt -- --check cargo clippy -- -D clippy::all -D missing_docs cargo clippy -p cwe_checker_lib --bench "benchmarks" -- -D clippy::all