diff --git a/.envrc b/.envrc index 1b5f158..5816063 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,2 @@ -# Insert our scripts into the path. export PATH=$PWD/scripts:$PATH - -# Nix flakes are awesome. -use flake +use flake || use nix 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