2022-05-12 23:10:51 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-09-11 21:16:24 +03:00
|
|
|
# Optional: Import test library bundled with the devcontainer CLI
|
|
|
|
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
|
|
|
|
# Provides the 'check' and 'reportResults' commands.
|
2022-05-13 03:07:22 +03:00
|
|
|
source dev-container-features-test-lib
|
2022-05-12 23:10:51 +03:00
|
|
|
|
2023-09-11 21:16:24 +03:00
|
|
|
# Feature-specific tests
|
|
|
|
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
|
|
|
|
# check <LABEL> <cmd> [args...]
|
|
|
|
source dotnet_env.sh
|
|
|
|
source dotnet_helpers.sh
|
2022-05-12 23:10:51 +03:00
|
|
|
|
2023-09-11 21:16:24 +03:00
|
|
|
expected=$(fetch_latest_version)
|
2022-11-14 22:41:32 +03:00
|
|
|
|
2023-09-11 21:16:24 +03:00
|
|
|
check "Latest .NET SDK version installed" \
|
|
|
|
is_dotnet_sdk_version_installed "$expected"
|
2022-08-17 00:33:25 +03:00
|
|
|
|
2023-09-11 21:16:24 +03:00
|
|
|
# Expect this check to fail in November 2023 when .NET 8.0 becomes GA
|
|
|
|
check "It is a flavor of .NET 7.0" \
|
|
|
|
is_dotnet_sdk_version_installed "7.0"
|
|
|
|
|
|
|
|
check "Build and run example project" \
|
|
|
|
dotnet run --project projects/net7.0
|
|
|
|
|
|
|
|
# Report results
|
|
|
|
# If any of the checks above exited with a non-zero exit code, the test will fail.
|
2022-05-12 23:10:51 +03:00
|
|
|
reportResults
|