Skip to content

Commit 89059f0

Browse files
authored
Some RWC tests had dupes in their input/outher files list because paths werent both resolved (microsoft#24235)
1 parent 8c2ed97 commit 89059f0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/harness/rwcRunner.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,29 @@ namespace RWC {
8989
const uniqueNames = ts.createMap<true>();
9090
for (const fileName of fileNames) {
9191
// Must maintain order, build result list while checking map
92-
const normalized = ts.normalizeSlashes(fileName);
92+
const normalized = ts.normalizeSlashes(Harness.IO.resolvePath(fileName));
9393
if (!uniqueNames.has(normalized)) {
9494
uniqueNames.set(normalized, true);
9595
// Load the file
96-
inputFiles.push(getHarnessCompilerInputUnit(fileName));
96+
inputFiles.push(getHarnessCompilerInputUnit(normalized));
9797
}
9898
}
9999

100100
// Add files to compilation
101101
for (const fileRead of ioLog.filesRead) {
102-
const normalized = ts.normalizeSlashes(fileRead.path);
103-
if (!uniqueNames.has(normalized) && !Harness.isDefaultLibraryFile(fileRead.path)) {
104-
uniqueNames.set(normalized, true);
105-
otherFiles.push(getHarnessCompilerInputUnit(fileRead.path));
102+
const unitName = ts.normalizeSlashes(Harness.IO.resolvePath(fileRead.path));
103+
if (!uniqueNames.has(unitName) && !Harness.isDefaultLibraryFile(fileRead.path)) {
104+
uniqueNames.set(unitName, true);
105+
otherFiles.push(getHarnessCompilerInputUnit(unitName));
106106
}
107-
else if (!opts.options.noLib && Harness.isDefaultLibraryFile(fileRead.path) && !uniqueNames.has(normalized) && useCustomLibraryFile) {
107+
else if (!opts.options.noLib && Harness.isDefaultLibraryFile(fileRead.path) && !uniqueNames.has(unitName) && useCustomLibraryFile) {
108108
// If useCustomLibraryFile is true, we will use lib.d.ts from json object
109109
// otherwise use the lib.d.ts from built/local
110110
// Majority of RWC code will be using built/local/lib.d.ts instead of
111111
// lib.d.ts inside json file. However, some RWC cases will still use
112112
// their own version of lib.d.ts because they have customized lib.d.ts
113-
uniqueNames.set(normalized, true);
114-
inputFiles.push(getHarnessCompilerInputUnit(fileRead.path));
113+
uniqueNames.set(unitName, true);
114+
inputFiles.push(getHarnessCompilerInputUnit(unitName));
115115
}
116116
}
117117
});

0 commit comments

Comments
 (0)