OverviewFilesCommitsIssuesDocsReleasesPeers

ifsrenderer-linux / packaging / run-tests.sh

31 lines · bash ref:
#!/bin/sh
# Runs the UI regression suite.
#
# Avalonia's headless platform drives the real visual tree with no display server, no
# compositor and no GPU, so this is safe on the pear-git runner. The suite exists because
# every bug it covers shipped once: see labs#3.
set -eu

# The pear-git runner exports Version=<branch>-<shortSha> (e.g. "linux-port-4ff4e86"), which
# MSBuild picks up as a project property and NuGet rejects during restore:
#
#   NuGet.targets(198,5): error : 'linux-port-4ff4e86' is not a valid version string.
#
# Unsetting alone was NOT enough here, though it is the documented fix in build-tarball.sh and
# it does work when this script is run by hand against a fresh `git archive` export. Rather than
# rely on it, this also passes an explicit version, which a project property cannot be
# overridden by the environment - the same belt-and-braces build-tarball.sh uses.
unset Version VersionPrefix VersionSuffix 2>/dev/null || true
BUILD_VERSION="${BUILD_VERSION:-1.5.0}"

# Printed to the log so a recurrence is diagnosable rather than guessed at.
echo "--- version env after unset ---"
env | grep -iE '^version' || echo "(none)"
echo "-------------------------------"

DOTNET="${DOTNET:-$HOME/.dotnet/dotnet}"

"$DOTNET" test AvaloniaShell.Tests/AvaloniaShell.Tests.csproj \
    -p:Version="$BUILD_VERSION" \
    --nologo --verbosity minimal