Skip to content

Commit

Permalink
chore: Add scripts for development
Browse files Browse the repository at this point in the history
  • Loading branch information
Apricot-S committed Sep 25, 2024
1 parent 4ba8389 commit 1b0d1bb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo rm -rf /var/lib/apt/lists/*

sudo chown vscode:vscode /workspaces

cargo install --force cargo-make
chmod +x scripts/*.sh

# Clone `nyanten`.
pushd /workspaces
Expand Down
23 changes: 0 additions & 23 deletions Makefile.toml

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/run_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

cargo bench --features bench
13 changes: 13 additions & 0 deletions scripts/test_correct_hands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

if [ -z "$1" ]; then
echo "Usage: $0 <01-14>"
exit 1
fi

if ! [[ "$1" =~ ^0[1-9]$|^1[0-4]$ ]]; then
echo "Error: Argument must be between 01 and 14."
exit 1
fi

cargo test correct_hands_$1 --release --features test -- --ignored
18 changes: 18 additions & 0 deletions scripts/test_verify_correctness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

if [ -z "$1" ]; then
echo "Usage: $0 <01-14>"
exit 1
fi

if ! [[ "$1" =~ ^0[1-9]$|^1[0-4]$ ]]; then
echo "Error: Argument must be between 01 and 14."
exit 1
fi

if (( $1 % 3 == 0 )); then
echo "Error: Argument must not be divisible by 3."
exit 1
fi

cargo test verify_correctness_$1 --release --features correctness -- --ignored

0 comments on commit 1b0d1bb

Please sign in to comment.