2015-11-25 01:47:33 +00:00
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
set -e
SOURCE = " ${ BASH_SOURCE [0] } "
while [ -h " $SOURCE " ] ; do # resolve $SOURCE until the file is no longer a symlink
DIR = " $( cd -P " $( dirname " $SOURCE " ) " && pwd ) "
SOURCE = " $( readlink " $SOURCE " ) "
2015-12-28 19:47:21 +00:00
[ [ " $SOURCE " != /* ] ] && SOURCE = " $DIR / $SOURCE " # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
2015-11-25 01:47:33 +00:00
done
DIR = " $( cd -P " $( dirname " $SOURCE " ) " && pwd ) "
2015-12-28 19:47:21 +00:00
source " $DIR /../common/_common.sh "
2015-12-15 01:39:29 +00:00
TestBinRoot = " $REPOROOT /artifacts/tests "
TestProjects = ( \
E2E \
2016-01-06 23:30:56 +00:00
StreamForwarderTests \
2015-12-15 01:39:29 +00:00
Microsoft.DotNet.Tools.Publish.Tests \
)
for project in ${ TestProjects [@] }
do
dotnet publish --framework "dnxcore50" --runtime " $RID " --output " $TestBinRoot " --configuration " $CONFIGURATION " " $REPOROOT /test/ $project "
done
# copy TestProjects folder which is used by the test cases
mkdir -p " $TestBinRoot /TestProjects "
2015-12-16 21:04:29 +00:00
cp -a $REPOROOT /test/TestProjects/* $TestBinRoot /TestProjects
2015-11-25 01:47:33 +00:00
2015-12-15 01:39:29 +00:00
pushd " $TestBinRoot "
2015-12-16 21:04:29 +00:00
set +e
failedTests = ( )
failCount = 0
2015-12-15 01:39:29 +00:00
for project in ${ TestProjects [@] }
do
2015-12-19 00:39:43 +00:00
./corerun "xunit.console.netcore.exe" " $project .dll " -xml " ${ project } -testResults.xml " -notrait category = failing
2015-12-16 21:04:29 +00:00
exitCode = $?
failCount += $exitCode
if [ $exitCode -ne 0 ] ; then
failedTests += ( $project )
fi
done
for test in ${ failedTests [@] }
do
2016-01-05 23:54:50 +00:00
error " $test .dll failed. Logs in ' $TestBinRoot / ${ test } -testResults.xml' "
2015-12-15 01:39:29 +00:00
done
2015-11-25 01:47:33 +00:00
popd
2015-12-16 21:04:29 +00:00
set -e
exit $failCount