Install sxs with the install-dotnet scripts (#124)

* Use dotnet-install scripts for proper sxs

* Update dotnet version in testing

* Error message cleanup

* SxS testing in the dotnet project

* Update package lock

* Test fixes

* Use proper environment variable

* Set dotnet root for windows
This commit is contained in:
Zachary Eisinger
2020-09-15 09:36:09 -07:00
committed by GitHub
parent 3569a93d9f
commit 352338157c
16 changed files with 775 additions and 1816 deletions

View File

@ -15,13 +15,30 @@ if [ -z "$(echo $dotnet_version | grep $1)" ]; then
exit 1
fi
if [ -n "$2" ]; then
dotnet_version="$(dotnet --list-sdks)"
echo "Found dotnet version '$dotnet_version'"
if [ -z "$(echo $dotnet_version | grep $2)" ]; then
echo "Unexpected version"
exit 1
fi
fi
echo "Building sample csproj"
dotnet build __tests__/sample-csproj/ --no-cache || exit 1
echo "Testing compiled app"
sample_output="$(__tests__/sample-csproj/bin/Debug/netcoreapp3.0/sample)"
sample_output=$(dotnet test __tests__/sample-csproj/ --no-build)
echo "Sample output: $sample_output"
if [ -z "$(echo $sample_output | grep Hello)" ]; then
echo "Unexpected output"
exit 1
# For Side-by-Side installs we want to run the tests twice, for a single install the tests will run once
if [ -n "$2" ]; then
if [ -z "$(echo $sample_output | grep "Test Run Successful.*Test Run Successful.")" ]; then
echo "Unexpected output"
exit 1
fi
else
if [ -z "$(echo $sample_output | grep "Test Run Successful.")" ]; then
echo "Unexpected output"
exit 1
fi
fi