Skip to content

Commit 4cf7874

Browse files
committed
Added test cases for --outDir option
1 parent 710bac6 commit 4cf7874

11 files changed

+420
-2
lines changed

src/harness/harness.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ module Harness {
660660
var useCaseSensitiveFileNames = sys.useCaseSensitiveFileNames;
661661
this.settings.forEach(setting => {
662662
switch (setting.flag.toLowerCase()) {
663-
// "filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve"
663+
// "filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noimplicitany", "noresolve"
664664
case "module":
665665
case "modulegentarget":
666666
if (typeof setting.value === 'string') {
@@ -1070,7 +1070,7 @@ module Harness {
10701070
var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines
10711071

10721072
// List of allowed metadata names
1073-
var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outDir", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames"];
1073+
var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames"];
10741074

10751075
function extractCompilerSettings(content: string): CompilerSetting[] {
10761076

tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/sourceMapWithCaseSensitiveFileNamesAndOutDir.js.map

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
===================================================================
2+
JsFile: app.js
3+
mapUrl: app.js.map
4+
sourceRoot:
5+
sources: ../testFiles/app.ts
6+
===================================================================
7+
-------------------------------------------------------------------
8+
emittedFile:tests/cases/compiler/testfiles/app.js
9+
sourceFile:../testFiles/app.ts
10+
-------------------------------------------------------------------
11+
>>>// Note in the out result we are using same folder name only different in casing
12+
1 >
13+
2 >
14+
3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
16+
1 >// Note in the out result we are using same folder name only different in casing
17+
>// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts
18+
>
19+
2 >
20+
3 >// Note in the out result we are using same folder name only different in casing
21+
1 >Emitted(1, 1) Source(3, 1) + SourceIndex(0)
22+
2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
23+
3 >Emitted(1, 81) Source(1, 81) + SourceIndex(0)
24+
---
25+
>>>// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts
26+
1->
27+
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
1->
29+
>
30+
2 >// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts
31+
1->Emitted(2, 1) Source(2, 1) + SourceIndex(0)
32+
2 >Emitted(2, 137) Source(2, 137) + SourceIndex(0)
33+
---
34+
>>>var c = (function () {
35+
1 >^^^^
36+
2 > ^
37+
3 > ^^^^^^^^^^^^^^->
38+
1 >
39+
>class
40+
2 > c
41+
1 >Emitted(3, 5) Source(3, 7) + SourceIndex(0)
42+
2 >Emitted(3, 6) Source(3, 8) + SourceIndex(0)
43+
---
44+
>>> function c() {
45+
1->^^^^
46+
2 > ^^^^^^^^^
47+
3 > ^
48+
1->
49+
2 > class
50+
3 > c
51+
1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) name (c)
52+
2 >Emitted(4, 14) Source(3, 7) + SourceIndex(0) name (c)
53+
3 >Emitted(4, 15) Source(3, 8) + SourceIndex(0) name (c)
54+
---
55+
>>> }
56+
1 >^^^^
57+
2 > ^
58+
3 > ^^^^^^^^^->
59+
1 > {
60+
>
61+
2 > }
62+
1 >Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (c.constructor)
63+
2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) name (c.constructor)
64+
---
65+
>>> return c;
66+
1->^^^^
67+
2 > ^^^^^^^^
68+
1->
69+
2 > }
70+
1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) name (c)
71+
2 >Emitted(6, 13) Source(4, 2) + SourceIndex(0) name (c)
72+
---
73+
>>>})();
74+
1 >
75+
2 >^
76+
3 >
77+
4 > ^^^^
78+
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^->
79+
1 >
80+
2 >}
81+
3 >
82+
4 > class c {
83+
> }
84+
1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) name (c)
85+
2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) name (c)
86+
3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0)
87+
4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0)
88+
---
89+
>>>//# sourceMappingURL=app.js.map===================================================================
90+
JsFile: app2.js
91+
mapUrl: app2.js.map
92+
sourceRoot:
93+
sources: ../testFiles/app2.ts
94+
===================================================================
95+
-------------------------------------------------------------------
96+
emittedFile:tests/cases/compiler/testfiles/app2.js
97+
sourceFile:../testFiles/app2.ts
98+
-------------------------------------------------------------------
99+
>>>var d = (function () {
100+
1 >
101+
2 >^^^^
102+
3 > ^
103+
4 > ^^^^^^^^^^^^^^->
104+
1 >
105+
2 >class
106+
3 > d
107+
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
108+
2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0)
109+
3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0)
110+
---
111+
>>> function d() {
112+
1->^^^^
113+
2 > ^^^^^^^^^
114+
3 > ^
115+
1->
116+
2 > class
117+
3 > d
118+
1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (d)
119+
2 >Emitted(2, 14) Source(1, 7) + SourceIndex(0) name (d)
120+
3 >Emitted(2, 15) Source(1, 8) + SourceIndex(0) name (d)
121+
---
122+
>>> }
123+
1 >^^^^
124+
2 > ^
125+
3 > ^^^^^^^^^->
126+
1 > {
127+
>
128+
2 > }
129+
1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (d.constructor)
130+
2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (d.constructor)
131+
---
132+
>>> return d;
133+
1->^^^^
134+
2 > ^^^^^^^^
135+
1->
136+
2 > }
137+
1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (d)
138+
2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (d)
139+
---
140+
>>>})();
141+
1 >
142+
2 >^
143+
3 >
144+
4 > ^^^^
145+
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^->
146+
1 >
147+
2 >}
148+
3 >
149+
4 > class d {
150+
> }
151+
1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (d)
152+
2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (d)
153+
3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
154+
4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
155+
---
156+
>>>//# sourceMappingURL=app2.js.map
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== tests/cases/compiler/testFiles/app.ts ===
2+
// Note in the out result we are using same folder name only different in casing
3+
// Since this is case sensitive, the folders are different and hence the relative paths in sourcemap shouldn't be just app.ts or app2.ts
4+
class c {
5+
>c : c
6+
}
7+
8+
=== tests/cases/compiler/testFiles/app2.ts ===
9+
class d {
10+
>d : d
11+
}

tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/sourceMapWithNonCaseSensitiveFileNamesAndOutDir.js.map

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)