Skip to content

Commit

Permalink
Enable test262 on CI (#11)
Browse files Browse the repository at this point in the history
Fixes: #3
  • Loading branch information
bnoordhuis authored Nov 4, 2023
1 parent b6e5541 commit 7be933e
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 23 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ on:
branches:
- master

# TODO(bnoordhuis) run test262 tests
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: stats
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y qjs
./qjs -qd
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y all run-test262
- name: test
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y test
make test test2
linux-asan:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ qjscalc
qjscalc.c
repl.c
run-test262
test262/
test262_*.txt
test_fib.c
tests/bjson.so
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "test262"]
path = test262
url = https://github.com/tc39/test262
shallow = true
27 changes: 22 additions & 5 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ enum test_mode_t {
TEST_STRICT, /* run tests as strict, skip nostrict tests */
TEST_ALL, /* run tests in both strict and nostrict, unless restricted by spec */
} test_mode = TEST_DEFAULT_NOSTRICT;
int compact;
int skip_async;
int skip_module;
int new_style;
Expand Down Expand Up @@ -1885,10 +1886,24 @@ void show_progress(int force) {
clock_t t = clock();
if (force || !last_clock || (t - last_clock) > CLOCKS_PER_SEC / 20) {
last_clock = t;
/* output progress indicator: erase end of line and return to col 0 */
fprintf(stderr, "%d/%d/%d\033[K\r",
test_failed, test_count, test_skipped);
fflush(stderr);
if (compact) {
static int last_test_skipped;
static int last_test_failed;
char c = '.';
if (test_skipped > last_test_skipped) c = '-';
if (test_failed > last_test_failed) c = '!';
last_test_skipped = test_skipped;
last_test_failed = test_failed;
fputc(c, stderr);
if (force)
fputc('\n', stderr);
fflush(stderr);
} else {
/* output progress indicator: erase end of line and return to col 0 */
fprintf(stderr, "%d/%d/%d\033[K\r",
test_failed, test_count, test_skipped);
fflush(stderr);
}
}
}

Expand Down Expand Up @@ -1968,6 +1983,7 @@ int main(int argc, char **argv)
BOOL is_module = FALSE;

#if !defined(_WIN32)
compact = !isatty(STDERR_FILENO);
/* Date tests assume California local time */
setenv("TZ", "America/Los_Angeles", 1);
#endif
Expand Down Expand Up @@ -2126,5 +2142,6 @@ int main(int argc, char **argv)
free(harness_exclude);
free(error_file);

return 0;
/* Signal that the error file is out of date. */
return new_errors || changed_errors || fixed_errors;
}
1 change: 1 addition & 0 deletions test262
Submodule test262 added at c1281d
34 changes: 26 additions & 8 deletions test262.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,41 @@ testdir=test262/test
# Standard language features and proposed extensions
# list the features that are included
# skipped features are tagged as such to avoid warnings
# Keep this list alpha-sorted (:sort i in vim)

__getter__
__proto__
__setter__
AggregateError
align-detached-buffer-semantics-with-web-reality
arbitrary-module-namespace-names=skip
array-find-from-last=skip
array-grouping=skip
Array.fromAsync=skip
Array.prototype.at=skip
Array.prototype.flat
Array.prototype.flatMap
Array.prototype.flatten
Array.prototype.includes
Array.prototype.values
ArrayBuffer
arraybuffer-transfer=skip
arrow-function
async-functions
async-iteration
Atomics
Atomics=skip # disabled because of Windows <-> pthreads
Atomics.waitAsync=skip
BigInt
caller
change-array-by-copy # works except for missing toReversed/toSorted/toSpliced
class
class-fields-private
class-fields-private-in=skip
class-fields-public
class-methods-private
class-static-block=skip
class-static-fields-public
class-static-fields-private
class-static-fields-public
class-static-methods-private
cleanupSome=skip
coalesce-expression
Expand All @@ -88,15 +97,17 @@ DataView.prototype.getInt8
DataView.prototype.getUint16
DataView.prototype.getUint32
DataView.prototype.setUint8
decorators=skip
default-parameters
destructuring-assignment
destructuring-binding
dynamic-import
error-cause=skip
exponentiation
export-star-as-namespace-from-module
FinalizationGroup=skip
FinalizationRegistry=skip
FinalizationRegistry.prototype.cleanupSome=skip
FinalizationRegistry=skip
Float32Array
Float64Array
for-in-order
Expand All @@ -105,13 +116,16 @@ generators
globalThis
hashbang
host-gc-required=skip
import.meta
import-assertions=skip
import-attributes=skip
import.meta
Int16Array
Int32Array
Int8Array
IsHTMLDDA
iterator-helpers=skip
json-modules=skip
json-parse-with-source=skip
json-superset
legacy-regexp=skip
let
Expand All @@ -127,6 +141,7 @@ Object.is
optional-catch-binding
optional-chaining
Promise
promise-with-resolvers=skip
Promise.allSettled
Promise.any
Promise.prototype.finally
Expand All @@ -137,22 +152,27 @@ Reflect.construct
Reflect.set
Reflect.setPrototypeOf
regexp-dotall
regexp-duplicate-named-groups=skip
regexp-lookbehind
regexp-match-indices=skip
regexp-named-groups
regexp-unicode-property-escapes
regexp-v-flag=skip
resizable-arraybuffer=skip
rest-parameters
Set
set-methods=skip
ShadowRealm=skip
SharedArrayBuffer
string-trimming
String.fromCodePoint
String.prototype.at=skip
String.prototype.endsWith
String.prototype.includes
String.prototype.at=skip
String.prototype.isWellFormed=skip
String.prototype.matchAll
String.prototype.replaceAll
String.prototype.toWellFormed=skip
String.prototype.trimEnd
String.prototype.trimStart
super
Expand All @@ -171,6 +191,7 @@ Symbol.split
Symbol.toPrimitive
Symbol.toStringTag
Symbol.unscopables
symbols-as-weakmap-keys
tail-call-optimization=skip
template
Temporal=skip
Expand All @@ -186,9 +207,6 @@ WeakMap
WeakRef=skip
WeakSet
well-formed-json-stringify
__getter__
__proto__
__setter__

[exclude]
# list excluded tests and directories here
Expand Down
Loading

0 comments on commit 7be933e

Please sign in to comment.