-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdiff_test.sh
More file actions
executable file
·40 lines (32 loc) · 977 Bytes
/
diff_test.sh
File metadata and controls
executable file
·40 lines (32 loc) · 977 Bytes
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
#!/usr/bin/env bash
set -u
SV_CARGO_DIR="$(dirname "$(realpath "$0")")"
SV_BIN_SYS="$(command -v SourceViewer)"
SV_BIN_CARGO="$SV_CARGO_DIR/target/release/SourceViewer"
# SV_BIN_CARGO="$HOME/temp-source-viewer"
BIN="$SV_CARGO_DIR/sample_code/llvm-impl/small"
# BIN="$SV_CARGO_DIR/sample_code/llvm-impl/libsmall_lang.so"
BIN="$(realpath "$BIN")"
COMMANDS=(
"sections"
"lines"
)
echo "=== Testing on small ==="
echo "Binary: $BIN"
echo "Cargo : $SV_BIN_CARGO"
echo "System : $SV_BIN_SYS"
echo
for cmd in "${COMMANDS[@]}"; do
echo "▶ [cargo] $cmd"
cargo_out="$(mktemp)"
"$SV_BIN_CARGO" "$cmd" "$BIN" >"$cargo_out" 2>&1
echo "▶ [system] $cmd"
system_out="$(mktemp)"
"$SV_BIN_SYS" "$cmd" "$BIN" >"$system_out" 2>&1
echo
echo "====== FULL DIFF for '$cmd' on small ======"
diff --color=always -u "$cargo_out" "$system_out"
echo "============================================"
echo
rm -f "$cargo_out" "$system_out"
done