Skip to content

Commit 0fc9097

Browse files
committed
[Disabled Tests] test/Error/rlexe.xml: tests tagged "fail" should be fixed and re-enabled chakra-core#3118
Re-enabled and updated prehistoric error source info baselines. jshost shows extended stack info for explicit throws, but ch does not. Exclude jshost from those tests, and run the tests in ChakraFull with a different baseline.
1 parent 0d52124 commit 0fc9097

15 files changed

Lines changed: 42 additions & 22 deletions

bin/ch/WScriptJsrt.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,13 @@ bool WScriptJsrt::PrintException(LPCSTR fileName, JsErrorCode jsErrorCode)
13691369
if (errorCode != JsErrorCode::JsNoError || propertyType == JsUndefined)
13701370
{
13711371
const char *fName = fileName != nullptr ? fileName : "(unknown)";
1372+
1373+
CHAR shortFileName[_MAX_PATH];
1374+
CHAR ext[_MAX_EXT];
1375+
_splitpath_s(fName, nullptr, 0, nullptr, 0, shortFileName, _countof(shortFileName), ext, _countof(ext));
1376+
13721377
// do not mix char/wchar. print them separately
1373-
fprintf(stderr, "thrown at %s:\n^\n", fName);
1378+
fprintf(stderr, "thrown at %s%s:\n^\n", shortFileName, ext);
13741379
fwprintf(stderr, _u("%ls\n"), errorMessage.GetWideString());
13751380
}
13761381
else

test/Error/rlexe.xml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,49 +62,53 @@
6262
<default>
6363
<files>sourceInfo_00.js</files>
6464
<baseline>sourceInfo_00.baseline</baseline>
65-
<tags>fail</tags>
65+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
6666
</default>
6767
</test>
6868
<test>
6969
<default>
7070
<files>sourceInfo_01.js</files>
7171
<baseline>sourceInfo_01.baseline</baseline>
72-
<tags>fail</tags>
72+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
73+
<tags>exclude_jshost</tags>
7374
</default>
7475
</test>
7576
<test>
7677
<default>
7778
<files>sourceInfo_10.js</files>
7879
<baseline>sourceInfo_10.baseline</baseline>
79-
<tags>fail</tags>
80+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
8081
</default>
8182
</test>
8283
<test>
8384
<default>
8485
<files>sourceInfo_11.js</files>
8586
<baseline>sourceInfo_11.baseline</baseline>
86-
<tags>fail</tags>
87+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
88+
<tags>exclude_jshost</tags>
8789
</default>
8890
</test>
8991
<test>
9092
<default>
9193
<files>sourceInfo_12.js</files>
9294
<baseline>sourceInfo_12.baseline</baseline>
93-
<tags>fail</tags>
95+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
9496
</default>
9597
</test>
9698
<test>
9799
<default>
98100
<files>sourceInfo_13.js</files>
99101
<baseline>sourceInfo_13.baseline</baseline>
100-
<tags>fail</tags>
102+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
103+
<tags>exclude_jshost</tags>
101104
</default>
102105
</test>
103106
<test>
104107
<default>
105108
<files>sourceInfo_20.js</files>
106109
<baseline>sourceInfo_20.baseline</baseline>
107-
<tags>fail</tags>
110+
<compile-flags>-ExtendedErrorStackForTestHost</compile-flags>
111+
<tags>exclude_jshost</tags>
108112
</default>
109113
</test>
110114
<test>

test/Error/sourceInfo_00.baseline

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
sourceInfo_00.js(9, 1) JavaScript runtime error: Object doesn't support this property or method
1+
ReferenceError: 'nosuchfunc' is not defined
2+
at Global code (sourceInfo_00.js:14:1)

test/Error/sourceInfo_00.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ function dummy() {
1111
}
1212

1313
dummy();
14-
nosuchfunc(); //9,1
14+
nosuchfunc();
1515
dummy();

test/Error/sourceInfo_01.baseline

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
sourceInfo_01.js(9, 3) JavaScript runtime error: Exception thrown and not caught
1+
thrown at sourceInfo_01.js:
2+
^
3+
123

test/Error/sourceInfo_01.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ function dummy() {
1111
}
1212

1313
dummy();
14-
throw 123; //9,3
14+
throw 123;
1515
dummy();

test/Error/sourceInfo_10.baseline

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
sourceInfo_10.js(10, 3) JavaScript runtime error: Object doesn't support this property or method
1+
TypeError: Object doesn't support property or method 'nosuchfunc'
2+
at Global code (sourceInfo_10.js:15:3)

test/Error/sourceInfo_10.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ function dummy() {
1212

1313
dummy();
1414
var obj = {};
15-
obj.nosuchfunc(); //10,3
15+
obj.nosuchfunc();
1616
dummy();

test/Error/sourceInfo_11.baseline

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
sourceInfo_11.js(12, 9) JavaScript runtime error: Exception thrown and not caught
1+
thrown at sourceInfo_11.js:
2+
^
3+
123

test/Error/sourceInfo_11.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dummy();
1414
var obj = {
1515
func: function () {
1616
dummy();
17-
throw 123; //12,9
17+
throw 123;
1818
dummy();
1919
}
2020
};

0 commit comments

Comments
 (0)