|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -e |
| 4 | + |
| 5 | +# Optional: Import test library bundled with the devcontainer CLI |
| 6 | +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib |
| 7 | +# Provides the 'check' and 'reportResults' commands. |
| 8 | +source dev-container-features-test-lib |
| 9 | + |
| 10 | +# Feature-specific tests |
| 11 | +# The 'check' command comes from the dev-container-features-test-lib. Syntax is... |
| 12 | +# check <LABEL> <cmd> [args...] |
| 13 | +source dotnet_env.sh |
| 14 | +source dotnet_helpers.sh |
| 15 | + |
| 16 | +check ".NET SDK 9.0 installed" \ |
| 17 | +is_dotnet_sdk_version_installed "9.0" |
| 18 | + |
| 19 | +check ".NET SDK 8.0 installed" \ |
| 20 | +is_dotnet_sdk_version_installed "8.0" |
| 21 | + |
| 22 | +check ".NET SDK 7.0 installed" \ |
| 23 | +is_dotnet_sdk_version_installed "7.0" |
| 24 | + |
| 25 | +check ".NET SDK 10.0 installed" \ |
| 26 | +is_dotnet_sdk_version_installed "10.0" |
| 27 | + |
| 28 | +check "Build example class library" \ |
| 29 | +dotnet build projects/multitargeting |
| 30 | + |
| 31 | +check "Build and run .NET 9.0 project" \ |
| 32 | +dotnet run --project projects/net9.0 |
| 33 | + |
| 34 | +check "Build and run .NET 8.0 project" \ |
| 35 | +dotnet run --project projects/net8.0 |
| 36 | + |
| 37 | +check "Build and run .NET 7.0 project" \ |
| 38 | +dotnet run --project projects/net7.0 |
| 39 | + |
| 40 | +check "Build and run .NET 10.0 project" \ |
| 41 | +dotnet run --project projects/net10.0 |
| 42 | + |
| 43 | +# Report results |
| 44 | +# If any of the checks above exited with a non-zero exit code, the test will fail. |
| 45 | +reportResults |
| 46 | + |
| 47 | + |
0 commit comments