@@ -35,6 +35,7 @@ namespace RWC {
35
35
const baseName = ts . getBaseFileName ( jsonPath ) ;
36
36
let currentDirectory : string ;
37
37
let useCustomLibraryFile : boolean ;
38
+ let caseSensitive : boolean ;
38
39
after ( ( ) => {
39
40
// Mocha holds onto the closure environment of the describe callback even after the test is done.
40
41
// Therefore we have to clean out large objects after the test is done.
@@ -47,7 +48,8 @@ namespace RWC {
47
48
// useCustomLibraryFile is a flag specified in the json object to indicate whether to use built/local/lib.d.ts
48
49
// or to use lib.d.ts inside the json object. If the flag is true, use the lib.d.ts inside json file
49
50
// otherwise use the lib.d.ts from built/local
50
- useCustomLibraryFile = undefined ! ;
51
+ useCustomLibraryFile = false ;
52
+ caseSensitive = false ;
51
53
} ) ;
52
54
53
55
it ( "can compile" , function ( this : Mocha . ITestCallbackContext ) {
@@ -93,7 +95,7 @@ namespace RWC {
93
95
if ( ! uniqueNames . has ( normalized ) ) {
94
96
uniqueNames . set ( normalized , true ) ;
95
97
// Load the file
96
- inputFiles . push ( getHarnessCompilerInputUnit ( normalized ) ) ;
98
+ inputFiles . push ( getHarnessCompilerInputUnit ( fileName ) ) ;
97
99
}
98
100
}
99
101
@@ -102,7 +104,7 @@ namespace RWC {
102
104
const unitName = ts . normalizeSlashes ( Harness . IO . resolvePath ( fileRead . path ) ! ) ;
103
105
if ( ! uniqueNames . has ( unitName ) && ! Harness . isDefaultLibraryFile ( fileRead . path ) ) {
104
106
uniqueNames . set ( unitName , true ) ;
105
- otherFiles . push ( getHarnessCompilerInputUnit ( unitName ) ) ;
107
+ otherFiles . push ( getHarnessCompilerInputUnit ( fileRead . path ) ) ;
106
108
}
107
109
else if ( ! opts . options . noLib && Harness . isDefaultLibraryFile ( fileRead . path ) && ! uniqueNames . has ( unitName ) && useCustomLibraryFile ) {
108
110
// If useCustomLibraryFile is true, we will use lib.d.ts from json object
@@ -111,7 +113,7 @@ namespace RWC {
111
113
// lib.d.ts inside json file. However, some RWC cases will still use
112
114
// their own version of lib.d.ts because they have customized lib.d.ts
113
115
uniqueNames . set ( unitName , true ) ;
114
- inputFiles . push ( getHarnessCompilerInputUnit ( unitName ) ) ;
116
+ inputFiles . push ( getHarnessCompilerInputUnit ( fileRead . path ) ) ;
115
117
}
116
118
}
117
119
} ) ;
@@ -122,11 +124,12 @@ namespace RWC {
122
124
opts . options . noLib = true ;
123
125
}
124
126
127
+ caseSensitive = ioLog . useCaseSensitiveFileNames || false ;
125
128
// Emit the results
126
129
compilerResult = Harness . Compiler . compileFiles (
127
130
inputFiles ,
128
131
otherFiles ,
129
- { useCaseSensitiveFileNames : "" + ( ioLog . useCaseSensitiveFileNames || false ) } ,
132
+ { useCaseSensitiveFileNames : "" + caseSensitive } ,
130
133
opts . options ,
131
134
// Since each RWC json file specifies its current directory in its json file, we need
132
135
// to pass this information in explicitly instead of acquiring it from the process.
@@ -182,7 +185,7 @@ namespace RWC {
182
185
// Do not include the library in the baselines to avoid noise
183
186
const baselineFiles = tsconfigFiles . concat ( inputFiles , otherFiles ) . filter ( f => ! Harness . isDefaultLibraryFile ( f . unitName ) ) ;
184
187
const errors = compilerResult . diagnostics . filter ( e => ! e . file || ! Harness . isDefaultLibraryFile ( e . file . fileName ) ) ;
185
- return Harness . Compiler . iterateErrorBaseline ( baselineFiles , errors ) ;
188
+ return Harness . Compiler . iterateErrorBaseline ( baselineFiles , errors , { caseSensitive , currentDirectory } ) ;
186
189
} , baselineOpts ) ;
187
190
} ) ;
188
191
@@ -202,7 +205,7 @@ namespace RWC {
202
205
compilerResult = undefined ! ;
203
206
const declFileCompilationResult = Harness . Compiler . compileDeclarationFiles ( declContext ) ! ;
204
207
205
- return Harness . Compiler . iterateErrorBaseline ( tsconfigFiles . concat ( declFileCompilationResult . declInputFiles , declFileCompilationResult . declOtherFiles ) , declFileCompilationResult . declResult . diagnostics ) ;
208
+ return Harness . Compiler . iterateErrorBaseline ( tsconfigFiles . concat ( declFileCompilationResult . declInputFiles , declFileCompilationResult . declOtherFiles ) , declFileCompilationResult . declResult . diagnostics , { caseSensitive , currentDirectory } ) ;
206
209
} , baselineOpts ) ;
207
210
}
208
211
} ) ;
0 commit comments