We only build it, we never run it, and it's fairly slow to build. It's
an almost verbatim copy of a sizable part of cutils.c that _is_ tested
so let's just remove it.
Fixes: https://github.com/quickjs-ng/quickjs/issues/788
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
Make sure the one set in the malloc functions is used rather than the
default one, since it will likely use a different allocator.
For some reason, this didn't cause a problem on macOS, but it does in
Linux. Opsie! Added some CI to prevent these kinds of bugs.
This way dependent projects only need to add this:
```
link_libraries(qjs)
```
or
```
target_link_libraries(mytarget qjs)
```
And CMake will link the resulting target with the libraries that qjs
needs too.
Since we don't keep timers sorted by deadline but by insertion order,
the test is flaky in slow environments (GHA seemingly). Increase the
timeouts to give it a bigger chance of success.
ASan / UBSan builds are notoriously slow, so skip the test in those.
I find it convenient to have access to JS_ReadObject and JS_WriteObject
from JS land. That's precisely the functionality that tests/bjson.c
provides, ergo, move it into quickjs-libc.c
* Add utility functions, improve integer conversion functions
- move `is_be()` to cutils.h
- add `is_upper_ascii()` and `to_upper_ascii()`
- add extensive benchmark for integer conversion variants in **tests/test_conv.c**
- add `u32toa()`, `i32toa()`, `u64toa()`, `i64toa()` based on register shift variant
- add `u32toa_radix()`, `u64toa_radix()`, `i64toa_radix()` based on length_loop variant
- use direct converters instead of `snprintf()`
- copy NaN and Infinity directly in `js_dtoa1()`
- optimize `js_number_toString()` for small integers
- use `JS_NewStringLen()` instead of `JS_NewString()` when possible
- add more precise conversion tests in microbench.js
- disable some benchmark tests for gcc (they cause ASAN failures)
run-test262 required pthreads, so let's add that. In addition, in MinGW,
clock_gettime is implemented in the pthreads library, so we want to link
it too.
This doesn't get us anywhere closer to building with ClangCL on Windows,
but hey, another target that required some tweaking...