addressed PR feedback
This commit is contained in:
parent
7d65b5b1a0
commit
076d65e1cf
|
@ -250,10 +250,11 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||||
// These types are equivalent, but depend on what order the compiler observed
|
// These types are equivalent, but depend on what order the compiler observed
|
||||||
// certain parts of the program.
|
// certain parts of the program.
|
||||||
|
|
||||||
const allFiles = toBeCompiled.concat(otherFiles).filter(file => !!result.program.getSourceFile(file.unitName));
|
const program = result.program;
|
||||||
|
const allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName));
|
||||||
|
|
||||||
const fullWalker = new TypeWriterWalker(result.program, /*fullTypeCheck*/ true);
|
const fullWalker = new TypeWriterWalker(program, /*fullTypeCheck*/ true);
|
||||||
const pullWalker = new TypeWriterWalker(result.program, /*fullTypeCheck*/ false);
|
const pullWalker = new TypeWriterWalker(program, /*fullTypeCheck*/ false);
|
||||||
|
|
||||||
const fullResults: ts.Map<TypeWriterResult[]> = {};
|
const fullResults: ts.Map<TypeWriterResult[]> = {};
|
||||||
const pullResults: ts.Map<TypeWriterResult[]> = {};
|
const pullResults: ts.Map<TypeWriterResult[]> = {};
|
||||||
|
|
|
@ -767,9 +767,9 @@ namespace Harness {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Harness {
|
namespace Harness {
|
||||||
const tcServicesFileName = "built/local/typescriptServices.js";
|
|
||||||
export const libFolder = "built/local/";
|
export const libFolder = "built/local/";
|
||||||
export let tcServicesFile = IO.readFile(tcServicesFileName);
|
const tcServicesFileName = ts.combinePaths(libFolder, "typescriptServices.js");
|
||||||
|
export const tcServicesFile = IO.readFile(tcServicesFileName);
|
||||||
|
|
||||||
export interface SourceMapEmitterCallback {
|
export interface SourceMapEmitterCallback {
|
||||||
(emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string): void;
|
(emittedFile: string, emittedLine: number, emittedColumn: number, sourceFile: string, sourceLine: number, sourceColumn: number, sourceName: string): void;
|
||||||
|
@ -990,7 +990,6 @@ namespace Harness {
|
||||||
options.noErrorTruncation = true;
|
options.noErrorTruncation = true;
|
||||||
options.skipDefaultLibCheck = true;
|
options.skipDefaultLibCheck = true;
|
||||||
|
|
||||||
const newLine = "\r\n";
|
|
||||||
currentDirectory = currentDirectory || Harness.IO.getCurrentDirectory();
|
currentDirectory = currentDirectory || Harness.IO.getCurrentDirectory();
|
||||||
|
|
||||||
// Parse settings
|
// Parse settings
|
||||||
|
@ -1002,27 +1001,30 @@ namespace Harness {
|
||||||
useCaseSensitiveFileNames = options.useCaseSensitiveFileNames;
|
useCaseSensitiveFileNames = options.useCaseSensitiveFileNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const programFiles: TestFile[] = inputFiles.slice();
|
||||||
// Files from built\local that are requested by test "@includeBuiltFiles" to be in the context.
|
// Files from built\local that are requested by test "@includeBuiltFiles" to be in the context.
|
||||||
// Treat them as library files, so include them in build, but not in baselines.
|
// Treat them as library files, so include them in build, but not in baselines.
|
||||||
const includeBuiltFiles: TestFile[] = [];
|
|
||||||
if (options.includeBuiltFile) {
|
if (options.includeBuiltFile) {
|
||||||
const builtFileName = libFolder + options.includeBuiltFile;
|
const builtFileName = ts.combinePaths(libFolder, options.includeBuiltFile);
|
||||||
const builtFile: TestFile = {
|
const builtFile: TestFile = {
|
||||||
unitName: builtFileName,
|
unitName: builtFileName,
|
||||||
content: normalizeLineEndings(IO.readFile(builtFileName), newLine),
|
content: normalizeLineEndings(IO.readFile(builtFileName), Harness.IO.newLine()),
|
||||||
};
|
};
|
||||||
includeBuiltFiles.push(builtFile);
|
programFiles.push(builtFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileOutputs: GeneratedFile[] = [];
|
const fileOutputs: GeneratedFile[] = [];
|
||||||
|
|
||||||
const programFiles = inputFiles.concat(includeBuiltFiles).map(file => file.unitName);
|
const programFileNames = programFiles.map(file => file.unitName);
|
||||||
|
|
||||||
const compilerHost = createCompilerHost(
|
const compilerHost = createCompilerHost(
|
||||||
inputFiles.concat(includeBuiltFiles).concat(otherFiles),
|
programFiles.concat(otherFiles),
|
||||||
(fileName, code, writeByteOrderMark) => fileOutputs.push({ fileName, code, writeByteOrderMark }),
|
(fileName, code, writeByteOrderMark) => fileOutputs.push({ fileName, code, writeByteOrderMark }),
|
||||||
options.target, useCaseSensitiveFileNames, currentDirectory, options.newLine);
|
options.target,
|
||||||
const program = ts.createProgram(programFiles, options, compilerHost);
|
useCaseSensitiveFileNames,
|
||||||
|
currentDirectory,
|
||||||
|
options.newLine);
|
||||||
|
const program = ts.createProgram(programFileNames, options, compilerHost);
|
||||||
|
|
||||||
const emitResult = program.emit();
|
const emitResult = program.emit();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ declare module ts {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module FourSlashInterface {
|
declare namespace FourSlashInterface {
|
||||||
interface Marker {
|
interface Marker {
|
||||||
fileName: string;
|
fileName: string;
|
||||||
position: number;
|
position: number;
|
||||||
|
@ -331,15 +331,6 @@ declare module FourSlashInterface {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare module fs {
|
|
||||||
var test: FourSlashInterface.test_;
|
|
||||||
var goTo: FourSlashInterface.goTo;
|
|
||||||
var verify: FourSlashInterface.verify;
|
|
||||||
var edit: FourSlashInterface.edit;
|
|
||||||
var debug: FourSlashInterface.debug;
|
|
||||||
var format: FourSlashInterface.format;
|
|
||||||
var cancellation: FourSlashInterface.cancellation;
|
|
||||||
}
|
|
||||||
declare function verifyOperationIsCancelled(f: any): void;
|
declare function verifyOperationIsCancelled(f: any): void;
|
||||||
declare var test: FourSlashInterface.test_;
|
declare var test: FourSlashInterface.test_;
|
||||||
declare var goTo: FourSlashInterface.goTo;
|
declare var goTo: FourSlashInterface.goTo;
|
||||||
|
|
Loading…
Reference in a new issue