2016-02-16 13:33:56 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2016-02-19 14:40:17 -08:00
|
|
|
# Test for build dependencies
|
|
|
|
|
hash cmake 2>/dev/null || { echo >&2 "No cmake, please run 'sudo apt-get install cmake'"; exit 1; }
|
|
|
|
|
hash g++ 2>/dev/null || { echo >&2 "No g++, please run 'sudo apt-get install g++'"; exit 1; }
|
|
|
|
|
hash dotnet 2>/dev/null || { echo >&2 "No dotnet, please visit https://dotnet.github.io/getting-started/"; exit 1; }
|
|
|
|
|
|
|
|
|
|
# Test for lock file
|
|
|
|
|
test -r test/csharp/project.lock.json || { echo >&2 "Please run 'dotnet restore' to download .NET Core packages"; exit 2; }
|
|
|
|
|
|
2016-02-16 13:33:56 -08:00
|
|
|
# Run xUnit tests
|
|
|
|
|
pushd test/csharp
|
|
|
|
|
## Build
|
2016-03-17 17:15:19 -07:00
|
|
|
dotnet build -c Linux
|
2016-02-16 13:33:56 -08:00
|
|
|
## Work-around dotnet/cli#753
|
2016-03-28 13:58:00 -07:00
|
|
|
cp -r -f ../../src/Microsoft.PowerShell.Linux.Host/{Modules,*.so,*.dylib} bin/Linux/netstandardapp1.5/ubuntu.14.04-x64 2>/dev/null
|
2016-02-16 13:33:56 -08:00
|
|
|
## Test
|
2016-03-17 17:15:19 -07:00
|
|
|
dotnet test -c Linux
|
2016-03-17 17:12:54 -07:00
|
|
|
result=$?
|
2016-02-16 13:33:56 -08:00
|
|
|
popd
|
2016-03-17 17:12:54 -07:00
|
|
|
|
|
|
|
|
exit $result
|