From: Dmitry Volyntsev Date: Tue, 22 Sep 2026 00:39:35 +0000 (-0700) Subject: Tests: rename local JavaScript test target X-Git-Tag: 1.0.2~27 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=eef4db01db4872bdc03fc9751d04573b8687e75a;p=njs.git Tests: rename local JavaScript test target Previously, the local JavaScript tests, including WebCrypto tests, were run by the test262 target, while the official TC39 Test262 suite was run by njs_test262_test. The fix is to rename the local test target to js_test and make test262 run the official suite. The engine-specific local targets are renamed to js_test_njs and js_test_quickjs. --- diff --git a/AGENTS.md b/AGENTS.md index 28af20a3..068495ca 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,7 +32,8 @@ Quick facts: - **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 nginx/t/`. - **Code style and commits:** follow diff --git a/auto/make b/auto/make index 7850b6b0..113ccbf8 100644 --- a/auto/make +++ b/auto/make @@ -336,13 +336,13 @@ lib_test: $NJS_BUILD_DIR/njs_auto_config.h \\ $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"; \\ @@ -358,7 +358,7 @@ unit_test: $NJS_BUILD_DIR/njs_auto_config.h \\ $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 @@ -369,18 +369,19 @@ END 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 diff --git a/docs/agent/engine-dev.md b/docs/agent/engine-dev.md index 89f0b78a..1b04dde6 100644 --- a/docs/agent/engine-dev.md +++ b/docs/agent/engine-dev.md @@ -88,8 +88,9 @@ Run `./configure --help` for the complete list. ```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` @@ -124,7 +125,7 @@ Before submitting a change: 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 nginx/t/`, once with the default engine and once with `TEST_NGINX_GLOBALS_HTTP='js_engine qjs;'`. diff --git a/test/help b/test/help index 465d6c25..71f80d64 100644 --- a/test/help +++ b/test/help @@ -5,7 +5,7 @@ cat << END -test/test262 [options] +test/js_test [options] options: diff --git a/test/test262 b/test/js_test similarity index 100% rename from test/test262 rename to test/js_test