Run every test only if it's build is successfull.
Else count it as failed it with "build error" message.
# Prepare
dotnet build TestRunner
+if ($lastexitcode -ne 0) {
+ throw ("Exec build test: " + $errorMessage)
+}
$test_pass = 0
$test_fail = 0
# Build, push and run tests
foreach ($TEST_NAME in $TEST_NAMES) {
dotnet build $TEST_NAME
+ if ($lastexitcode -ne 0) {
+ $test_fail++
+ $test_list = "$test_list$TEST_NAME ... failed: build error`n"
+ continue
+ }
$SOURCE_FILE_LIST = (Get-ChildItem -Path "$TEST_NAME" -Recurse -Filter *.cs | Where {$_.FullName -notlike "*\obj\*"} | Resolve-path -relative).Substring(2)
TEST_NAMES="${ALL_TEST_NAMES[@]}"
fi
-dotnet build TestRunner
+dotnet build TestRunner || exit $?
test_pass=0
test_fail=0
test_list=""
for TEST_NAME in $TEST_NAMES; do
- dotnet build $TEST_NAME
+ dotnet build $TEST_NAME || {
+ echo "$TEST_NAME: build error." >&2
+ test_fail=$(($test_fail + 1))
+ test_list="$test_list$TEST_NAME ... failed: build error\n"
+ continue
+ }
SOURCE_FILES=$(find $TEST_NAME \! -path "$TEST_NAME/obj/*" -type f -name "*.cs" -printf '%p;')