From 16880cb36e748cd195e5ad85c4100e4209cc594c Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Mon, 5 Sep 2022 22:23:39 -0500 Subject: [PATCH] chore: making tests more intelligent --- scripts/test.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index bb106ee..7587fb1 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,8 +1,12 @@ #!/usr/bin/env sh cd $(dirname $0)/.. -./scripts/setup.sh || exit 1 -dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage" -dotnet tool run reportgenerator -reports:tests/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary" -grep "Line coverage" coverage/Summary.txt +if [ -f ./tests/*/*.csproj ] +then + ./scripts/setup.sh || exit 1 + + dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Default;FailureBodyFormat=Verbose" --collect:"XPlat Code Coverage" + dotnet tool run reportgenerator -reports:tests/*/TestResults/*/coverage.cobertura.xml -targetdir:./coverage "-reporttypes:Cobertura;TextSummary" + grep "Line coverage" coverage/Summary.txt +fi