-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·69 lines (57 loc) · 1.82 KB
/
test.sh
File metadata and controls
executable file
·69 lines (57 loc) · 1.82 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
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
set -e
NET_EXE="mono"
DOTNET_CLI_EXE="dotnet"
NUGET_EXE=".nuget/nuget.exe"
NUGET_URL="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
NUNIT_RUNNER_EXE="./tools/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe"
BUILD_EXE="msbuild"
# Make sure mono is installed
if [ ! hash $NET_EXE 2>/dev/null ]; then
echo "Could not find $NET_EXE. Exiting" >&2
exit 1
fi
# Make sure dotnet (the CLI) is installed
if [ ! hash $DOTNET_CLI_EXE 2>/dev/null ]; then
echo "Could not find $DOTNET_CLI_EXE. Exiting" >&2
exit 1
fi
# Install Nuget if it isn't present
if [ ! -d "$DIRECTORY" ]; then
mkdir -p .nuget
fi
if [ ! -f $NUGET_EXE 2>/dev/null ]; then
if hash curl 2>/dev/null; then
curl -o $NUGET_EXE $NUGET_URL
elif hash curl 2>/dev/null; then
wget -O $NUGET_EXE $NUGET_URL
else
echo "Could not find curl or wget. Exiting" >&2
exit 1
fi
fi
# Restore the nuget packages
$NET_EXE $NUGET_EXE restore phaxio-dotnet.sln
# Install the test runner if it's not present
if [ ! -f $NUNIT_RUNNER_EXE ]; then
$NET_EXE .$NUGET_EXE install NUnit.Runners -Version 3.6.1 -OutputDirectory tools
fi
# Build the project
$BUILD_EXE phaxio-dotnet.sln /p:Configuration=Release /verbosity:quiet
# See if this is an integration test
RUNLIST=""
if [ "$1" = "integration" ]; then
echo $1
echo "Running integration tests\n"
RUNLIST="--testlist=./Phaxio.Tests/IntegrationTestsRunList.txt"
fi
# See if this is an integration test
RUNLIST=""
if [ "$1" = "integration" ]; then
echo $1
echo "Running integration tests\n"
RUNLIST="--testlist=./Phaxio.Tests/IntegrationTestsRunList.txt"
fi
# Run the tests
$NET_EXE $NUNIT_RUNNER_EXE $RUNLIST ./Phaxio.Tests/bin/Release/net45/Phaxio.Tests.dll
$DOTNET_CLI_EXE test --framework netcoreapp2.0 ./Phaxio.Tests/Phaxio.Tests.csproj