forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·61 lines (49 loc) · 1.35 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Run unit tests for the Soroban contract
#
# I designed this script to run all tests with helpful output.
# It can also run specific tests if a pattern is provided.
#
# Usage:
# ./test.sh # Run all tests
# ./test.sh create # Run tests matching 'create'
# ./test.sh --verbose # Run with verbose output
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CONTRACT_DIR="$SCRIPT_DIR/../split-escrow"
echo "🧪 Running Split Escrow Contract Tests"
echo " Contract: $CONTRACT_DIR"
echo ""
cd "$CONTRACT_DIR"
# Parse arguments
VERBOSE=""
TEST_PATTERN=""
for arg in "$@"; do
case $arg in
--verbose|-v)
VERBOSE="--nocapture"
;;
*)
TEST_PATTERN="$arg"
;;
esac
done
# Build test command
CMD="cargo test"
if [ -n "$TEST_PATTERN" ]; then
CMD="$CMD $TEST_PATTERN"
echo "🔍 Running tests matching: $TEST_PATTERN"
fi
if [ -n "$VERBOSE" ]; then
CMD="$CMD -- $VERBOSE"
echo "📝 Verbose output enabled"
fi
echo ""
echo "Running: $CMD"
echo "─────────────────────────────────────────"
echo ""
# Run tests
$CMD
echo ""
echo "─────────────────────────────────────────"
echo "✅ All tests passed!"