Issue 21519 - Generate coverage reports for Win64 on Azure

Current coverage report is linux only, this adds reports for Win64.

Win32 is currently excluded because dmd fails the test suite with weird
linker errors when using  coverage build.
This commit is contained in:
MoonlightSentinel 2021-01-09 20:58:25 +01:00 committed by The Dlang Bot
parent 5fe6348db8
commit 85e095203c
2 changed files with 55 additions and 7 deletions

View file

@ -91,13 +91,6 @@ for proj in druntime phobos; do
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}"
done
################################################################################
# Build and run druntime tests
################################################################################
cd "$DMD_DIR/../druntime"
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" unittest test_all
################################################################################
# Run DMD testsuite
################################################################################
@ -109,6 +102,15 @@ cd ../test
"$HOST_DC" -m$MODEL -g -i run.d
./run tools
# Rebuild dmd with ENABLE_COVERAGE for coverage tests
if [ "${DMD_TEST_COVERAGE:-0}" = "1" ] ; then
# Recompile debug dmd + unittests
rm -rf "$DMD_DIR/generated/windows"
DFLAGS="-L-LARGEADDRESSAWARE" ../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd
DFLAGS="-L-LARGEADDRESSAWARE" ../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest
fi
if [ "$MODEL" == "32" ] ; then
# WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's.
# Optlink apparently prefers LIB in sc.ini over the LIB env variable (and
@ -126,6 +128,29 @@ if [ "$HOST_DMD_VERSION" = "2.079.0" ] ; then
fi
CC="$CC" ./run --environment --jobs=$N "${targets[@]}" "${args[@]}"
###############################################################################
# Upload coverage reports and exit if ENABLE_COVERAGE is specified
################################################################################
if [ "${DMD_TEST_COVERAGE:-0}" = "1" ] ; then
cd $DMD_DIR
# CodeCov gets confused by lst files which it can't match
rm -rf test/runnable/extra-files test/*.lst
download "https://codecov.io/bash" "codecov.sh"
bash ./codecov.sh -p . -Z
rm codecov.sh
# Skip druntime & phobos tests
exit 0
fi
################################################################################
# Build and run druntime tests
################################################################################
cd "$DMD_DIR/../druntime"
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" unittest test_all
################################################################################
# Build and run Phobos unittests
################################################################################

View file

@ -44,6 +44,29 @@ jobs:
- template: .azure-pipelines/windows.yml
- template: .azure-pipelines/windows-artifact.yml
- job: Windows_Coverage
timeoutInMinutes: 120
pool:
vmImage: 'vs2017-win2016'
variables:
D_COMPILER: dmd
HOST_DMD_VERSION: LATEST
DMD_TEST_COVERAGE: 1
strategy:
matrix:
x64:
OS: Win_64
MODEL: 64
ARCH: x64
# x64 only because 32bit causes weird linker errors for several tests???
# x86-OMF:
# OS: Win_32
# MODEL: 32
# ARCH: x86
steps:
- template: .azure-pipelines/windows.yml
- job: Windows_VisualD_LDC
timeoutInMinutes: 120
pool: