Skip to content

Commit

Permalink
rewrite cargo make tests to avoid run same test multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Sep 26, 2024
1 parent cb59924 commit 7798fbc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CORE = { script = ["grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}'"] }
RAYON_NUM_THREADS = "${CORE}"
CUR_TARGET = { script = [
# Command to check if the variable is not set, then assign output of the bash command
'''
if [ -z "${TARGET}" ]; then
TARGET=$(rustc -vV | grep "host" | awk '{print $2}')
Expand All @@ -13,8 +12,21 @@ CUR_TARGET = { script = [
fi
'''
]}
TASK_RUN = { script = [
'''
exclude_projects="singer_pro ceno_rt"
# Check if CARGO_MAKE_CRATE_NAME is in the exclude_projects string
if echo "$exclude_projects" | grep -q -w "${CARGO_MAKE_CRATE_NAME}"; then
echo "false"
else
echo "true"
fi
'''
]}

[tasks.tests]
condition = { env_true = ["TASK_RUN"] }
command = "cargo"
args = ["test-all-features", "--lib", "--release", "--target", "${CUR_TARGET}", "-p", "${CARGO_MAKE_CRATE_NAME}"]

Expand Down
2 changes: 2 additions & 0 deletions mpcs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ transcript = { path = "../transcript" }
plonky2 = "0.2.0"

[dev-dependencies]
simple-frontend = { path = "../simple-frontend" }
gkr = { path = "../gkr" }
criterion = { version = "0.5", features = ["html_reports"] }

[features]
Expand Down

0 comments on commit 7798fbc

Please sign in to comment.