Skip to content

Commit 66ea16a

Browse files
committed
Sample to baseline output
1 parent e54d5ca commit 66ea16a

22 files changed

+2166
-307
lines changed

src/testRunner/unittests/tsbuild/helpers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ interface Symbol {
279279
buildKind: BuildKind;
280280
modifyFs: (fs: vfs.FileSystem) => void;
281281
subScenario?: string;
282+
commandLineArgs?: readonly string[];
282283
}
283284

284285
export interface VerifyTsBuildInput extends TscCompile {
@@ -318,7 +319,12 @@ interface Symbol {
318319
verifyTscBaseline(() => sys);
319320
});
320321

321-
for (const { buildKind, modifyFs, subScenario: incrementalSubScenario } of incrementalScenarios) {
322+
for (const {
323+
buildKind,
324+
modifyFs,
325+
subScenario: incrementalSubScenario,
326+
commandLineArgs: incrementalCommandLineArgs
327+
} of incrementalScenarios) {
322328
describe(incrementalSubScenario || buildKind, () => {
323329
let newSys: TscCompileSystem;
324330
before(() => {
@@ -329,7 +335,7 @@ interface Symbol {
329335
subScenario: incrementalSubScenario || subScenario,
330336
buildKind,
331337
fs: () => sys.vfs,
332-
commandLineArgs,
338+
commandLineArgs: incrementalCommandLineArgs || commandLineArgs,
333339
modifyFs: fs => {
334340
tick();
335341
modifyFs(fs);

src/testRunner/unittests/tsbuild/sample.ts

Lines changed: 113 additions & 305 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//// [/lib/incremental-declaration-changesOutput.txt]
2+
/lib/tsc --b /src/tests --verbose
3+
12:08:00 AM - Projects in this build:
4+
* src/core/tsconfig.json
5+
* src/logic/tsconfig.json
6+
* src/tests/tsconfig.json
7+
8+
12:08:00 AM - Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts'
9+
10+
12:08:00 AM - Building project '/src/core/tsconfig.json'...
11+
12+
12:08:00 AM - Updating unchanged output timestamps of project '/src/core/tsconfig.json'...
13+
14+
12:08:00 AM - Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies
15+
16+
12:08:00 AM - Updating output timestamps of project '/src/logic/tsconfig.json'...
17+
18+
12:08:00 AM - Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies
19+
20+
12:08:00 AM - Updating output timestamps of project '/src/tests/tsconfig.json'...
21+
22+
exitCode:: ExitStatus.Success
23+
24+
25+
//// [/src/core/index.d.ts] file written with same contents
26+
//// [/src/core/index.d.ts.map]
27+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAyB,CAAC;AACnD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"}
28+
29+
//// [/src/core/index.js]
30+
"use strict";
31+
exports.__esModule = true;
32+
exports.someString = "WELCOME PLANET";
33+
function leftPad(s, n) { return s + n; }
34+
exports.leftPad = leftPad;
35+
function multiply(a, b) { return a * b; }
36+
exports.multiply = multiply;
37+
38+
39+
//// [/src/core/index.ts]
40+
export const someString: string = "WELCOME PLANET";
41+
export function leftPad(s: string, n: number) { return s + n; }
42+
export function multiply(a: number, b: number) { return a * b; }
43+
44+
45+
//// [/src/core/tsconfig.tsbuildinfo]
46+
{
47+
"program": {
48+
"fileInfos": {
49+
"../../lib/lib.d.ts": {
50+
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
51+
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
52+
},
53+
"./anothermodule.ts": {
54+
"version": "-2676574883-export const World = \"hello\";\r\n",
55+
"signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map"
56+
},
57+
"./index.ts": {
58+
"version": "-2157245566-export const someString: string = \"WELCOME PLANET\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",
59+
"signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map"
60+
},
61+
"./some_decl.d.ts": {
62+
"version": "-9253692965-declare const dts: any;\r\n",
63+
"signature": "-9253692965-declare const dts: any;\r\n"
64+
}
65+
},
66+
"options": {
67+
"composite": true,
68+
"declaration": true,
69+
"declarationMap": true,
70+
"skipDefaultLibCheck": true,
71+
"configFilePath": "./tsconfig.json"
72+
},
73+
"referencedMap": {},
74+
"exportedModulesMap": {},
75+
"semanticDiagnosticsPerFile": [
76+
"../../lib/lib.d.ts",
77+
"./anothermodule.ts",
78+
"./index.ts",
79+
"./some_decl.d.ts"
80+
]
81+
},
82+
"version": "FakeTSVersion"
83+
}
84+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//// [/lib/incremental-declaration-changesOutput.txt]
2+
/lib/tsc --b /src/tests --verbose --force
3+
12:16:00 AM - Projects in this build:
4+
* src/core/tsconfig.json
5+
* src/logic/tsconfig.json
6+
* src/tests/tsconfig.json
7+
8+
12:16:00 AM - Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js'
9+
10+
12:16:00 AM - Building project '/src/core/tsconfig.json'...
11+
12+
12:16:00 AM - Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies
13+
14+
12:16:00 AM - Building project '/src/logic/tsconfig.json'...
15+
16+
12:16:00 AM - Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies
17+
18+
12:16:00 AM - Building project '/src/tests/tsconfig.json'...
19+
20+
exitCode:: ExitStatus.Success
21+
22+
23+
//// [/src/core/anotherModule.d.ts] file written with same contents
24+
//// [/src/core/anotherModule.d.ts.map] file written with same contents
25+
//// [/src/core/anotherModule.js] file written with same contents
26+
//// [/src/core/index.d.ts] file written with same contents
27+
//// [/src/core/index.d.ts.map] file written with same contents
28+
//// [/src/core/index.js] file written with same contents
29+
//// [/src/core/tsconfig.tsbuildinfo] file written with same contents
30+
//// [/src/logic/index.d.ts] file written with same contents
31+
//// [/src/logic/index.js] file written with same contents
32+
//// [/src/logic/index.js.map] file written with same contents
33+
//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents
34+
//// [/src/tests/index.d.ts] file written with same contents
35+
//// [/src/tests/index.js] file written with same contents
36+
//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//// [/lib/incremental-declaration-changesOutput.txt]
2+
/lib/tsc --b /src/tests --verbose
3+
12:04:00 AM - Projects in this build:
4+
* src/core/tsconfig.json
5+
* src/logic/tsconfig.json
6+
* src/tests/tsconfig.json
7+
8+
12:04:00 AM - Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js'
9+
10+
12:04:00 AM - Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js'
11+
12+
12:04:00 AM - Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json'
13+
14+
12:04:00 AM - Building project '/src/tests/tsconfig.json'...
15+
16+
exitCode:: ExitStatus.Success
17+
18+
19+
//// [/src/tests/index.d.ts] file written with same contents
20+
//// [/src/tests/index.js] file written with same contents
21+
//// [/src/tests/tsconfig.base.json]
22+
{"compilerOptions":{}}
23+
24+
//// [/src/tests/tsconfig.tsbuildinfo]
25+
{
26+
"program": {
27+
"fileInfos": {
28+
"../../lib/lib.d.ts": {
29+
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
30+
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
31+
},
32+
"../core/index.ts": {
33+
"version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map",
34+
"signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map"
35+
},
36+
"../core/anothermodule.ts": {
37+
"version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",
38+
"signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map"
39+
},
40+
"../logic/index.ts": {
41+
"version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",
42+
"signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
43+
},
44+
"./index.ts": {
45+
"version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
46+
"signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
47+
}
48+
},
49+
"options": {
50+
"composite": true,
51+
"declaration": true,
52+
"forceConsistentCasingInFileNames": true,
53+
"skipDefaultLibCheck": true,
54+
"configFilePath": "./tsconfig.json"
55+
},
56+
"referencedMap": {
57+
"../logic/index.ts": [
58+
"../core/anothermodule.d.ts"
59+
],
60+
"./index.ts": [
61+
"../core/anothermodule.d.ts",
62+
"../core/index.d.ts",
63+
"../logic/index.d.ts"
64+
]
65+
},
66+
"exportedModulesMap": {
67+
"../logic/index.ts": [
68+
"../core/anothermodule.d.ts"
69+
],
70+
"./index.ts": [
71+
"../core/anothermodule.d.ts"
72+
]
73+
},
74+
"semanticDiagnosticsPerFile": [
75+
"../../lib/lib.d.ts",
76+
"../core/anothermodule.ts",
77+
"../core/index.ts",
78+
"../logic/index.ts",
79+
"./index.ts"
80+
]
81+
},
82+
"version": "FakeTSVersion"
83+
}
84+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//// [/lib/incremental-declaration-changesOutput.txt]
2+
/lib/tsc --b /src/tests --verbose
3+
12:20:00 AM - Projects in this build:
4+
* src/core/tsconfig.json
5+
* src/logic/tsconfig.json
6+
* src/tests/tsconfig.json
7+
8+
12:20:00 AM - Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js'
9+
10+
12:20:00 AM - Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js'
11+
12+
12:20:00 AM - Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json'
13+
14+
12:20:00 AM - Building project '/src/tests/tsconfig.json'...
15+
16+
exitCode:: ExitStatus.Success
17+
18+
19+
//// [/src/tests/index.d.ts] file written with same contents
20+
//// [/src/tests/index.js] file written with same contents
21+
//// [/src/tests/tsconfig.json]
22+
{
23+
"references": [
24+
{ "path": "../core" },
25+
{ "path": "../logic" }
26+
],
27+
"files": ["index.ts"],
28+
"compilerOptions": {
29+
"composite": true, "target": "es3",
30+
"declaration": true,
31+
"forceConsistentCasingInFileNames": true,
32+
"skipDefaultLibCheck": true
33+
}
34+
}
35+
36+
//// [/src/tests/tsconfig.tsbuildinfo]
37+
{
38+
"program": {
39+
"fileInfos": {
40+
"../../lib/lib.d.ts": {
41+
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
42+
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
43+
},
44+
"../core/index.ts": {
45+
"version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map",
46+
"signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map"
47+
},
48+
"../core/anothermodule.ts": {
49+
"version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",
50+
"signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map"
51+
},
52+
"../logic/index.ts": {
53+
"version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",
54+
"signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
55+
},
56+
"./index.ts": {
57+
"version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
58+
"signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
59+
}
60+
},
61+
"options": {
62+
"composite": true,
63+
"target": 0,
64+
"declaration": true,
65+
"forceConsistentCasingInFileNames": true,
66+
"skipDefaultLibCheck": true,
67+
"configFilePath": "./tsconfig.json"
68+
},
69+
"referencedMap": {
70+
"../logic/index.ts": [
71+
"../core/anothermodule.d.ts"
72+
],
73+
"./index.ts": [
74+
"../core/anothermodule.d.ts",
75+
"../core/index.d.ts",
76+
"../logic/index.d.ts"
77+
]
78+
},
79+
"exportedModulesMap": {
80+
"../logic/index.ts": [
81+
"../core/anothermodule.d.ts"
82+
],
83+
"./index.ts": [
84+
"../core/anothermodule.d.ts"
85+
]
86+
},
87+
"semanticDiagnosticsPerFile": [
88+
"../../lib/lib.d.ts",
89+
"../core/anothermodule.ts",
90+
"../core/index.ts",
91+
"../logic/index.ts",
92+
"./index.ts"
93+
]
94+
},
95+
"version": "FakeTSVersion"
96+
}
97+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
2+
/lib/tsc --b /src/tests --verbose
3+
12:04:00 AM - Projects in this build:
4+
* src/core/tsconfig.json
5+
* src/logic/tsconfig.json
6+
* src/tests/tsconfig.json
7+
8+
12:04:00 AM - Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js'
9+
10+
12:04:00 AM - Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js'
11+
12+
12:04:00 AM - Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/index.ts'
13+
14+
12:04:00 AM - Building project '/src/tests/tsconfig.json'...
15+
16+
exitCode:: ExitStatus.Success
17+
18+
19+
//// [/src/tests/index.d.ts]
20+
declare const m = 10;
21+
22+
23+
//// [/src/tests/index.js]
24+
var m = 10;
25+
26+
27+
//// [/src/tests/index.ts]
28+
const m = 10;
29+
30+
//// [/src/tests/tsconfig.tsbuildinfo]
31+
{
32+
"program": {
33+
"fileInfos": {
34+
"../../lib/lib.d.ts": {
35+
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };",
36+
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };"
37+
},
38+
"./index.ts": {
39+
"version": "3708260210-const m = 10;",
40+
"signature": "1073907769-declare const m = 10;\r\n"
41+
}
42+
},
43+
"options": {
44+
"composite": true,
45+
"declaration": true,
46+
"forceConsistentCasingInFileNames": true,
47+
"skipDefaultLibCheck": true,
48+
"configFilePath": "./tsconfig.json"
49+
},
50+
"referencedMap": {},
51+
"exportedModulesMap": {},
52+
"semanticDiagnosticsPerFile": [
53+
"../../lib/lib.d.ts",
54+
"./index.ts"
55+
]
56+
},
57+
"version": "FakeTSVersion"
58+
}
59+

0 commit comments

Comments
 (0)