Fix test scripts for bash

This commit is contained in:
Piotr Puszkiewicz 2016-01-10 12:53:16 -08:00
parent 096b7d21dc
commit d1fba98348

View file

@ -21,7 +21,7 @@ dotnet pack --output "$REPOROOT/artifacts/packages" "$REPOROOT/test/PackagedComm
dotnet pack --output "$REPOROOT/artifacts/packages" "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello" dotnet pack --output "$REPOROOT/artifacts/packages" "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello"
# enable restore for test projects # enable restore for test projects
for test in `ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith")
do do
pushd "$REPOROOT/test/PackagedCommands/Consumers/$test" pushd "$REPOROOT/test/PackagedCommands/Consumers/$test"
cp "project.json.template" "project.json" cp "project.json.template" "project.json"
@ -34,7 +34,7 @@ dotnet restore -s "$REPOROOT/artifacts/packages" --no-cache --ignore-failed-sour
popd popd
#compile tests with direct dependencies #compile tests with direct dependencies
for test in `ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "Direct"` for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "Direct")
do do
pushd "$REPOROOT/test/PackagedCommands/Consumers/$test" pushd "$REPOROOT/test/PackagedCommands/Consumers/$test"
dotnet compile dotnet compile
@ -42,7 +42,7 @@ do
done done
#run test #run test
for test in `ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith"` for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith")
do do
testName="test/PackagedCommands/Consumers/$test" testName="test/PackagedCommands/Consumers/$test"
@ -52,13 +52,13 @@ do
rm "project.json" rm "project.json"
if [ $testOutput != "hello" ] if [ "$output" == "Hello" ] ;
then then
error "Test Failed: $testName/dotnet hello"
error " printed $testOutput"
exit 1
else
echo "Test Passed: $testName" echo "Test Passed: $testName"
else
error "Test Failed: $testName/dotnet hello"
error " printed $output"
exit 1
fi fi
popd popd