Skip to content

Commit

Permalink
Pass repoRoot with trailing slash in correctness tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Jul 22, 2021
1 parent 07eb3dd commit 2d236f6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions eng/test-build-correctness.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ try {
# Verify the state of our various build artifacts
Write-Host "Running BuildBoss"
$buildBossPath = GetProjectOutputBinary "BuildBoss.exe"
Exec-Console $buildBossPath "-r `"$RepoRoot`" -c $configuration" -p Roslyn.sln
Exec-Console $buildBossPath "-r `"$RepoRoot/`" -c $configuration" -p Roslyn.sln
Write-Host ""

# Verify the state of our generated syntax files
Write-Host "Checking generated compiler files"
Exec-Block { & (Join-Path $PSScriptRoot "generate-compiler-code.ps1") -test -configuration:$configuration }
Exec-Console dotnet "format . --include-generated --include src/Compilers/CSharp/Portable/Generated/ src/Compilers/VisualBasic/Portable/Generated/ src/ExpressionEvaluator/VisualBasic/Source/ResultProvider/Generated/ --check -f"
Write-Host ""
Write-Host ""

exit 0
}
catch [exception] {
Expand Down
34 changes: 17 additions & 17 deletions eng/test-determinism.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if ($help) {
}

# List of binary names that should be skipped because they have a known issue that
# makes them non-deterministic.
# makes them non-deterministic.
$script:skipList = @(
# Added to work around https://github.com/dotnet/roslyn/issues/48417
"Microsoft.CodeAnalysis.EditorFeatures2.UnitTests.dll"
Expand Down Expand Up @@ -67,11 +67,11 @@ function Run-Build([string]$rootDir, [string]$logFileName) {
Stop-Processes
}

function Get-ObjDir([string]$rootDir) {
function Get-ObjDir([string]$rootDir) {
return Join-Path $rootDir "artifacts\obj"
}

function Get-BinDir([string]$rootDir) {
function Get-BinDir([string]$rootDir) {
return Join-Path $rootDir "artifacts\bin"
}

Expand All @@ -80,7 +80,7 @@ function Get-BinDir([string]$rootDir) {
function Get-FilesToProcess([string]$rootDir) {
$objDir = Get-ObjDir $rootDir
foreach ($item in Get-ChildItem -re -in *.dll,*.exe,*.pdb,*.sourcelink.json $objDir) {
$filePath = $item.FullName
$filePath = $item.FullName
$fileName = Split-Path -leaf $filePath
$relativeDirectory = Split-Path -parent $filePath
$relativeDirectory = $relativeDirectory.Substring($objDir.Length)
Expand All @@ -103,7 +103,7 @@ function Get-FilesToProcess([string]$rootDir) {

$keyFilePath = $filePath + ".key"
$keyFileName = Split-Path -leaf $keyFilePath
if (Test-Path $keyFilePath) {
if (Test-Path $keyFilePath) {
$data.KeyFileName = $keyFileName
$data.KeyFilePath = $keyFilePath
$data.KeyFileContent = [IO.File]::ReadAllBytes($keyFilePath)
Expand All @@ -124,7 +124,7 @@ function Record-Binaries([string]$rootDir) {
Write-Host "Recording file hashes"

$map = @{ }
foreach ($fileData in Get-FilesToProcess $rootDir) {
foreach ($fileData in Get-FilesToProcess $rootDir) {
Write-Host "`t$($fileData.FileId) = $($fileData.Hash)"
$map[$fileData.FileId] = $fileData
}
Expand All @@ -134,9 +134,9 @@ function Record-Binaries([string]$rootDir) {
}

# This is a sanity check to ensure that we're actually putting the right entries into
# the core data map. Essentially to ensure things like if we change our directory layout
# that this test fails beacuse we didn't record the binaries we intended to record.
function Test-MapContents($dataMap) {
# the core data map. Essentially to ensure things like if we change our directory layout
# that this test fails beacuse we didn't record the binaries we intended to record.
function Test-MapContents($dataMap) {

# Sanity check to ensure we didn't return a false positive because we failed
# to examine any binaries.
Expand All @@ -151,16 +151,16 @@ function Test-MapContents($dataMap) {
"Microsoft.CodeAnalysis.Workspaces.dll",
"Microsoft.VisualStudio.LanguageServices.Implementation.dll")

foreach ($fileName in $list) {
foreach ($fileName in $list) {
$found = $false
foreach ($value in $dataMap.Values) {
if ($value.FileName -eq $fileName) {
foreach ($value in $dataMap.Values) {
if ($value.FileName -eq $fileName) {
$found = $true
break;
}
}

if (-not $found) {
if (-not $found) {
throw "Did not find the expected binary $fileName"
}
}
Expand All @@ -187,7 +187,7 @@ function Test-Build([string]$rootDir, $dataMap, [string]$logFileName) {
}

$oldfileData = $datamap[$fileId]
if ($fileData.Hash -ne $oldFileData.Hash) {
if ($fileData.Hash -ne $oldFileData.Hash) {
Write-Host "`tERROR! $relativeDir\$fileName contents don't match"
$allGood = $false
$errorList += $fileName
Expand Down Expand Up @@ -242,13 +242,13 @@ function Run-Test() {
# Run a test against the source in the same directory location
Test-Build -rootDir $RepoRoot -dataMap $dataMap -logFileName "test1"

# Run another build in a different source location and verify that path mapping
# allows the build to be identical. To do this we'll copy the entire source
# Run another build in a different source location and verify that path mapping
# allows the build to be identical. To do this we'll copy the entire source
# tree under the artifacts\q directory and run a build from there.
Write-Host "Building in a different directory"
Exec-Command "subst" "$altRootDrive $(Split-Path -parent $RepoRoot)"
try {
$altRootDir = Join-Path "$($altRootDrive)\" (Split-Path -leaf $RepoRoot)
$altRootDir = Join-Path "$($altRootDrive)\" (Split-Path -leaf $RepoRoot) "\"
Test-Build -rootDir $altRootDir -dataMap $dataMap -logFileName "test2"
}
finally {
Expand Down
4 changes: 2 additions & 2 deletions eng/test-rebuild.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#
This script tests that Roslyn artifacts are rebuildable--i.e. that the source code and resources can be identified
This script tests that Roslyn artifacts are rebuildable--i.e. that the source code and resources can be identified
#>

[CmdletBinding(PositionalBinding=$false)]
Expand Down Expand Up @@ -63,7 +63,7 @@ try {
" --exclude net472\Zip\tools\vsixexpinstaller\VSIXExpInstaller.exe" +

" --debugPath `"$ArtifactsDir/BuildValidator`"" +
" --sourcePath `"$RepoRoot`"" +
" --sourcePath `"$RepoRoot/`"" +
" --referencesPath `"$ArtifactsDir/bin`"" +
" --referencesPath `"$dotnetInstallDir/packs`"")
Exec-Console "$ArtifactsDir/bin/BuildValidator/$configuration/net472/BuildValidator.exe" $rebuildArgs
Expand Down

0 comments on commit 2d236f6

Please sign in to comment.