From 39be99644ceb47df34e4e789a78e4fa6b27febc6 Mon Sep 17 00:00:00 2001 From: aggstam Date: Tue, 6 Jun 2023 14:44:18 +0300 Subject: [PATCH] contract/*: created test-no-run target in Makefile --- src/contract/consensus/Makefile | 11 +++++++++-- src/contract/dao/Makefile | 8 +++++++- src/contract/money/Makefile | 17 +++++++++++++---- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/contract/consensus/Makefile b/src/contract/consensus/Makefile index 71f04b711..5038f9f20 100644 --- a/src/contract/consensus/Makefile +++ b/src/contract/consensus/Makefile @@ -19,6 +19,9 @@ WASM_SRC = \ # wasm contract binary WASM_BIN = consensus_contract.wasm +# Just compile the tests +NO_RUN = "--no-run" + all: $(WASM_BIN) $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN) @@ -31,15 +34,19 @@ $(PROOFS_BIN): $(ZKAS) $(PROOFS_SRC) test-stake-unstake: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-consensus-contract \ - --test stake_unstake + --test stake_unstake $(ARGS) test-genesis-stake-unstake: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-consensus-contract \ - --test genesis_stake_unstake + --test genesis_stake_unstake $(ARGS) test: test-genesis-stake-unstake test-stake-unstake +test-no-run: + $(MAKE) test-genesis-stake-unstake ARGS=$(NO_RUN) + $(MAKE) test-stake-unstake ARGS=$(NO_RUN) + clean: rm -f $(PROOFS_BIN) $(WASM_BIN) diff --git a/src/contract/dao/Makefile b/src/contract/dao/Makefile index 16b404e0b..a49a60bce 100644 --- a/src/contract/dao/Makefile +++ b/src/contract/dao/Makefile @@ -19,6 +19,9 @@ WASM_SRC = \ # wasm contract binary WASM_BIN = dao_contract.wasm +# Just compile the tests +NO_RUN = "--no-run" + all: $(WASM_BIN) $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN) @@ -31,10 +34,13 @@ $(PROOFS_BIN): $(ZKAS) $(PROOFS_SRC) test-integration: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-dao-contract \ - --test integration + --test integration $(ARGS) test: test-integration +test-no-run: + $(MAKE) test-integration ARGS=$(NO_RUN) + clean: rm -f $(PROOFS_BIN) $(WASM_BIN) diff --git a/src/contract/money/Makefile b/src/contract/money/Makefile index 47f40aa0c..b034e5317 100644 --- a/src/contract/money/Makefile +++ b/src/contract/money/Makefile @@ -19,6 +19,9 @@ WASM_SRC = \ # wasm contract binary WASM_BIN = money_contract.wasm +# Just compile the tests +NO_RUN = "--no-run" + all: $(WASM_BIN) $(WASM_BIN): $(WASM_SRC) $(PROOFS_BIN) @@ -31,22 +34,22 @@ $(PROOFS_BIN): $(ZKAS) $(PROOFS_SRC) test-integration: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-money-contract \ - --test integration + --test integration $(ARGS) test-mint-pay-swap: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-money-contract \ - --test mint_pay_swap + --test mint_pay_swap $(ARGS) test-txs-verification: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-money-contract \ - --test txs_verification + --test txs_verification $(ARGS) test-genesis-mint: all $(CARGO) test --release --features=no-entrypoint,client \ --package darkfi-money-contract \ - --test genesis_mint + --test genesis_mint $(ARGS) bench: $(CARGO) test --release --features=no-entrypoint,client \ @@ -55,6 +58,12 @@ bench: test: test-integration test-mint-pay-swap test-txs-verification test-genesis-mint +test-no-run: + $(MAKE) test-integration ARGS=$(NO_RUN) + $(MAKE) test-mint-pay-swap ARGS=$(NO_RUN) + $(MAKE) test-txs-verification ARGS=$(NO_RUN) + $(MAKE) test-genesis-mint ARGS=$(NO_RUN) + clean: rm -f $(PROOFS_BIN) $(WASM_BIN)