Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up test intermediates when clean test rebuild is requested #62001

Merged
merged 2 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/tests/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ set "__TestBinDir=%__TestRootDir%\%__OSPlatformConfig%"
set "__TestIntermediatesDir=%__TestRootDir%\obj\%__OSPlatformConfig%"

if "%__RebuildTests%" == "1" (
echo Removing tests build dir^: !__TestBinDir!
echo Removing test build dir^: !__TestBinDir!
rmdir /s /q !__TestBinDir!
echo Removing test intermediate dir^: !__TestIntermediatesDir!
rmdir /s /q !__TestIntermediatesDir!
)

REM We have different managed and native intermediate dirs because the managed bits will include
Expand Down
15 changes: 7 additions & 8 deletions src/tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ build_Tests()
echo "${__MsgPrefix}Building Tests..."

__ProjectFilesDir="$__TestDir"
__TestBinDir="$__TestWorkingDir"
__Exclude="$__RepoRootDir/src/tests/issues.targets"

if [[ -f "${__TestWorkingDir}/build_info.json" ]]; then
rm "${__TestWorkingDir}/build_info.json"
if [[ -f "${__TestBinDir}/build_info.json" ]]; then
rm "${__TestBinDir}/build_info.json"
fi

if [[ "$__RebuildTests" -ne 0 ]]; then
Expand Down Expand Up @@ -363,7 +362,7 @@ __OSPlatformConfig="$__TargetOS.$__BuildArch.$__BuildType"
__BinDir="$__RootBinDir/bin/coreclr/$__OSPlatformConfig"
__PackagesBinDir="$__BinDir/.nuget"
__TestDir="$__RepoRootDir/src/tests"
__TestWorkingDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig"
__TestBinDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig"
__IntermediatesDir="$__RootBinDir/obj/coreclr/$__OSPlatformConfig"
__TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig"
__CrossCompIntermediatesDir="$__IntermediatesDir/crossgen"
Expand All @@ -382,10 +381,10 @@ if [[ -z "$HOME" ]]; then
fi

if [[ "$__RebuildTests" -ne 0 ]]; then
if [[ -d "${__TestWorkingDir}" ]]; then
echo "Removing tests build dir: ${__TestWorkingDir}"
rm -rf "${__TestWorkingDir}"
fi
echo "Removing test build dir: ${__TestBinDir}"
rm -rf "${__TestBinDir}"
echo "Removing test intermediate dir: ${__TestIntermediatesDir}"
rm -rf "${__TestIntermediatesDir}"
fi

build_Tests
Expand Down