- **Dual engine = dual code.** Most external modules ship both an `njs_*.c`
and a `qjs_*.c` implementation. If you change behavior on one side, change
it on the other.
-- **Tests:** `make unit_test`, `make lib_test`, `make test262`. NGINX
+- **Tests:** `make unit_test`, `make lib_test`, `make js_test`, and
+ `make test262`. NGINX
integration tests under `nginx/t/` run with
`prove -I <tests-lib> nginx/t/`.
- **Code style and commits:** follow
$NJS_BUILD_DIR/flathsh_unit_test
$NJS_BUILD_DIR/unicode_unit_test
-test262_njs: njs
- test/test262 --binary=$NJS_BUILD_DIR/njs
+js_test_njs: njs
+ test/js_test --binary=$NJS_BUILD_DIR/njs
njs_test262: $NJS_BUILD_DIR/njs_auto_config.h \\
$NJS_BUILD_DIR/njs_test262
-njs_test262_test: njs_test262
+test262: njs_test262
@test -n "\$\$NJS_TEST262_DIR" || { \\
echo "NJS_TEST262_DIR is not set, it must point at a"; \\
$NJS_BUILD_DIR/njs_unit_test
-test: shell_test unit_test lib_test test262
+test: shell_test unit_test lib_test js_test
benchmark: $NJS_BUILD_DIR/njs_auto_config.h \\
$NJS_BUILD_DIR/njs_benchmark
if [ $NJS_HAVE_QUICKJS = YES ]; then
cat << END >> $NJS_MAKEFILE
-test262: njs test262_njs test262_quickjs
+js_test: js_test_njs js_test_quickjs
-test262_quickjs: njs
+js_test_quickjs: njs
NJS_SKIP_LIST="test/js/promise_rejection_tracker_recursive.t.js \\
test/js/async_exception_in_await.t.js" \\
- test/test262 --binary='$NJS_BUILD_DIR/njs -n QuickJS -m'
+ test/js_test --binary='$NJS_BUILD_DIR/njs -n QuickJS -m'
+
END
else
cat << END >> $NJS_MAKEFILE
-test262: njs test262_njs
+js_test: js_test_njs
END
fi
```bash
make unit_test # 5800+ language and API tests
make lib_test # internal data structures (hash, rbtree, unicode)
-make test262 # ECMAScript test262 compliance suite
-make test # shell tests + unit_test + test262
+make js_test # repository JavaScript tests, including WebCrypto
+make test262 # official TC39 Test262 suite
+make test # shell tests + unit_test + lib_test + js_test
```
NGINX integration tests live under `nginx/t/` and use Perl's `prove`
1. `./configure && make -j$(nproc)` compiles without warnings (`-Werror`).
2. `make unit_test` and `make lib_test` pass.
-3. If you touched `src/`, also run `make test262`.
+3. If you touched `src/`, also run `make js_test` and `make test262`.
4. If you touched `nginx/`, run `prove -I <TESTS_LIB> nginx/t/`,
once with the default engine and once with
`TEST_NGINX_GLOBALS_HTTP='js_engine qjs;'`.
cat << END
-test/test262 [options] <DIR or FILE path>
+test/js_test [options] <DIR or FILE path>
options: