-
Notifications
You must be signed in to change notification settings - Fork 265
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·55 lines (49 loc) · 1.34 KB
/
test.sh
File metadata and controls
executable file
·55 lines (49 loc) · 1.34 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
#!/usr/bin/env bash
set -e
scriptroot="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
testproject="$scriptroot/src/Microsoft.Diagnostics.Runtime.Tests/Microsoft.Diagnostics.Runtime.Tests.csproj"
exitcode=0
arch="${1}"
shift 2>/dev/null || true
run_64() {
echo "=== Running 64-bit tests ==="
dotnet test "$testproject" --arch x64 "$@" || exitcode=1
}
can_run_32() {
dotnet --info --arch x86 >/dev/null 2>&1
}
run_32() {
if ! can_run_32; then
echo "=== Skipping 32-bit tests (x86 .NET runtime not found) ==="
return
fi
echo "=== Running 32-bit tests ==="
dotnet test "$testproject" --arch x86 "$@" || exitcode=1
}
case "$arch" in
""|"--help")
if [ -z "$arch" ]; then
run_64 "$@"
echo ""
run_32 "$@"
else
echo "Usage: test.sh [arch] [dotnet test args...]"
echo " No args: run both 32-bit and 64-bit tests"
echo " x86, x32, arm: run 32-bit tests only"
echo " x64, amd64, arm64: run 64-bit tests only"
exit 1
fi
;;
x86|x32|arm)
run_32 "$@"
;;
x64|amd64|arm64)
run_64 "$@"
;;
*)
echo "Unknown architecture: $arch"
echo "Use x86/x32/arm for 32-bit, x64/amd64/arm64 for 64-bit"
exit 1
;;
esac
exit $exitcode