]> git.kaiwu.me - njs.git/commitdiff
Tests: rename local JavaScript test target
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 22 Sep 2026 00:39:35 +0000 (17:39 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 25 Sep 2026 23:00:29 +0000 (16:00 -0700)
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.

AGENTS.md
auto/make
docs/agent/engine-dev.md
test/help
test/js_test [moved from test/test262 with 100% similarity]

index 28af20a3efe50f03bd2fec98ab55bc7af764157f..068495cab699a4b036242e68938b1f35b0cd47ed 100644 (file)
--- 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 <tests-lib> nginx/t/`.
 - **Code style and commits:** follow
index 7850b6b092833061ea1d0b43d99bbd8e7604a976..113ccbf8a239d158045480cc30e68e0890d0e8d8 100644 (file)
--- 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
index 89f0b78ad7fdbd36cab548f9d3d10bd065267f67..1b04dde626ca4477f2c3643c2b673173e696b52f 100644 (file)
@@ -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 <TESTS_LIB> nginx/t/`,
    once with the default engine and once with
    `TEST_NGINX_GLOBALS_HTTP='js_engine qjs;'`.
index 465d6c2593dabeff13b26144a9d52531dfbd1eff..71f80d645b89df3bfb0283fa81feeb3b67c3a36d 100644 (file)
--- a/test/help
+++ b/test/help
@@ -5,7 +5,7 @@
 
 cat << END
 
-test/test262 [options] <DIR or FILE path>
+test/js_test [options] <DIR or FILE path>
 
 options:
 
similarity index 100%
rename from test/test262
rename to test/js_test