]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
add test
authorYann Collet <cyan@fb.com>
Mon, 10 Mar 2025 20:40:47 +0000 (13:40 -0700)
committerYann Collet <cyan@fb.com>
Mon, 10 Mar 2025 20:40:47 +0000 (13:40 -0700)
checks that ZSTD_NBTHREADS triggers the expected verbose message

Also: checked that the new test script fails on current `dev` branch, and is fixed by this branch

tests/playTests.sh

index 65aa5c0b1cbe817a9c0b660ececc8ca0f24ab5eb..366f9c741e9af82a692eb4599da9c58670a62e05 100755 (executable)
@@ -1570,7 +1570,11 @@ then
     ZSTD_NBTHREADS=3a7 zstd -f mt_tmp # malformed env var, warn and revert to default setting
     ZSTD_NBTHREADS=50000000000 zstd -f mt_tmp # numeric value too large, warn and revert to default setting=
     ZSTD_NBTHREADS=2  zstd -f mt_tmp # correct usage
-    ZSTD_NBTHREADS=1  zstd -f mt_tmp # correct usage: single thread
+    ZSTD_NBTHREADS=1  zstd -f mt_tmp # correct usage: single worker
+    ZSTD_NBTHREADS=4 zstd -f mt_tmp -vv 2>&1 | grep "4 worker threads" # check message
+    zstd -tq mt_tmp.zst
+    ZSTD_NBTHREADS=0 zstd -f mt_tmp -vv 2>&1 | grep "core(s) detected" # check core count autodetection is triggered
+    zstd -tq mt_tmp.zst
     # temporary envvar changes in the above tests would actually persist in macos /bin/sh
     unset ZSTD_NBTHREADS
     rm -f mt_tmp*