From bae0dae9a625b77b8357460ffec08c180ab2eebc Mon Sep 17 00:00:00 2001 From: Fotis Koutoulakis Date: Wed, 18 Jan 2023 18:21:08 +0000 Subject: [PATCH] Add a `justfile` with basic support for building CBMC and executing Rust API tests. This is a rudimentary file, added as a base for easy running of the Rust API tests locally and online - as it allows for literally one-step build + test. Over time I intend for this to be used for two purposes: 1. Streamline building of CBMC for existing and new contributors 2. Streamline build infrastructure in CI. Also adding mysefl as a codeowner for the file just so that I can be notified about any changes made to it (assuming I'm the person with the most `just` knowledge for now). --- CODEOWNERS | 1 + justfile | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 justfile diff --git a/CODEOWNERS b/CODEOWNERS index ca5205524c0..1eb0f78cc17 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -67,6 +67,7 @@ /cmake/ @diffblue/diffblue-opensource CMakeLists.txt @diffblue/diffblue-opensource +justfile @NlightNFotis # These files change frequently and changes are low-risk diff --git a/justfile b/justfile new file mode 100644 index 00000000000..d45228d30e4 --- /dev/null +++ b/justfile @@ -0,0 +1,24 @@ +# This is a `justfile`, for the program `just`, a task runner. +# Think of it as a better make for targets that are actions rather than +# files. For more information, look at https://github.com/casey/just + +default_build_dir := 'build/' +default_solver := 'minisat2' + +# Perform a default (debug) build on MacOS systems under folder `build/` +[macos] +build: + cmake -S. -B{{default_build_dir}} -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ + cmake --build build -j4 + +# Perform a default (debug) build on Linux systems under folder `build/` +[linux] +build: + cmake -S. -B{{default_build_dir}} + cmake --build build -j4 + +# Test the Rust API (under src/libcprover-rust/) +test-rust-api: build + cd src/libcprover-rust;\ + cargo clean;\ + CBMC_BUILD_DIR={{justfile_directory()}}/{{default_build_dir}} SAT_IMPL={{default_solver}} cargo test -- --test-threads=1