In verboser mode (-vv):
- show the output of print() calls
- print exception stack traces
Also sneak in a minor bug fix where I forgot to atomically increment
the fixed_errors variable.
Before this commit it segfaulted, now it throws a SyntaxError.
That's still not correct behavior but better than segfaulting.
To be continued.
Includes a small run-test262 fix to handle Windows line endings.
Refs: https://github.com/quickjs-ng/quickjs/issues/567
This commit introduces a couple of changes in order to make run-test262
go brr and execute tests in parallel:
- Remove CONFIG_AGENT build option. The disabled version of the build
was already broken and no one noticed, Remove the define altogether.
- Remove the -C switch. Hard to support in multi-threaded mode.
I may bring it back some day because it _is_ useful.
- Remove the -r switch. Also hard to support and I never look at
test262_report.txt anyway so on the chopping block it goes.
- Judicious use of thread-local storage so I don't have to thread
through state everywhere and embiggen the diff even more.
This is what Real Programmers(TM) do: stay up coding way past midnight
just so the test suite finishes in one minute instead of four.
Fixes: https://github.com/quickjs-ng/quickjs/issues/547
It's currently printing them whenever a test takes one millisecond or
longer to complete.
Introduced in commit 7db24cc0da from earlier today, mea culpa.
- output more informative error messages in `js_parse_expect`.
The previous code was bogus:
```
return js_parse_error(s, "expecting '%c'", tok);
```
this was causing a bug on `eval("do;")` where `tok` is `TOK_WHILE` (-70, 0xBA)
creating an invalid UTF-8 encoding (lone trailing byte).
This would ultimately have caused a failure in `JS_ThrowError2` if `JS_NewString`
failed when converting the error message to a string if the conversion detected the invalid
UTF-8 encoding and throwed an error (it currently does not, but should).
- test for `JS_NewString` failure in `JS_ThrowError2`
- test for `JS_FreeCString` failure in run-test262.c
- add more test cases
JSValueConst was only used for the now removed CONFIG_CHECK_JSVALUE
build mode. It is kept around as an alias for JSValue in quickjs.h to
avoid breaking everyone's source builds but remove it everywhere else.
The default 256 kb stack is too small to run some of the test262 tests
when ASAN is enabled.
Double it to 512 kb and ensure threads created by quickjs have big
enough stacks.
Before this commit the output of the test262 step was only visible in
the web interface at the end of the test run. Now it prints a status
update every few seconds.