]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
test: update libzstd_builds.sh for disabled legacy default
authorYann Collet <cyan@meta.com>
Thu, 18 Dec 2025 21:39:28 +0000 (13:39 -0800)
committerYann Collet <cyan@meta.com>
Thu, 18 Dec 2025 21:39:28 +0000 (13:39 -0800)
Summary:
Updates the library build tests to reflect that legacy format support is now disabled by default. Also adds a new test case to verify that legacy support can still be explicitly enabled via ZSTD_LEGACY_SUPPORT=5.

Test Plan:
Run `bash tests/libzstd_builds.sh` on a Linux environment.

tests/libzstd_builds.sh

index f9e1e76c6357d987d8679908f07058eecbfdc3d2..3b019c8b85fae120d875baf101d83e427e00eb11 100755 (executable)
@@ -21,14 +21,14 @@ mustBeAbsent() {
     $ECHO "$@ correctly not present"  # for some reason, this $ECHO must exist, otherwise mustBeAbsent() always fails (??)
 }
 
-# default compilation : all features enabled - no zbuff
+# default compilation : all features enabled - no zbuff, no legacy
 $ECHO "testing default library compilation"
 CFLAGS= make -C $DIR/../lib libzstd libzstd.a > $INTOVOID
 nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
 isPresent "zstd_compress.o"
 isPresent "zstd_decompress.o"
 isPresent "zdict.o"
-isPresent "zstd_v07.o"
+mustBeAbsent "zstd_v07.o"
 mustBeAbsent "zbuff_compress.o"
 $RM tmplog
 
@@ -44,7 +44,7 @@ nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
 mustBeAbsent "zstd_compress.o"
 isPresent "zstd_decompress.o"
 mustBeAbsent "zdict.o"
-isPresent "zstd_v07.o"
+mustBeAbsent "zstd_v07.o"
 mustBeAbsent "zbuff_compress.o"
 $RM $DIR/../lib/libzstd.a tmplog
 
@@ -66,7 +66,7 @@ nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
 isPresent "zstd_compress.o"
 isPresent "zstd_decompress.o"
 isPresent "zdict.o"
-isPresent "zstd_v07.o"
+mustBeAbsent "zstd_v07.o"
 mustBeAbsent "zbuff_compress.o"
 $RM $DIR/../lib/libzstd.a tmplog
 
@@ -77,7 +77,7 @@ nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
 isPresent "zstd_compress.o"
 isPresent "zstd_decompress.o"
 isPresent "zdict.o"
-isPresent "zstd_v07.o"
+mustBeAbsent "zstd_v07.o"
 isPresent "zbuff_compress.o"
 $RM $DIR/../lib/libzstd.a tmplog
 
@@ -88,7 +88,7 @@ nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
 isPresent "zstd_compress.o"
 isPresent "zstd_decompress.o"
 mustBeAbsent "zdict.o"
-isPresent "zstd_v07.o"
+mustBeAbsent "zstd_v07.o"
 mustBeAbsent "zbuff_compress.o"
 $RM $DIR/../lib/libzstd.a tmplog
 
@@ -102,3 +102,14 @@ mustBeAbsent "zdict.o"
 mustBeAbsent "zstd_v07.o"
 mustBeAbsent "zbuff_compress.o"
 $RM $DIR/../lib/libzstd.a tmplog
+
+# legacy support explicitly enabled
+$ECHO "testing with legacy support explicitly enabled"
+ZSTD_LEGACY_SUPPORT=5 CFLAGS= make -C $DIR/../lib libzstd.a > $INTOVOID
+nm $DIR/../lib/libzstd.a | $GREP "\.o" > tmplog
+isPresent "zstd_compress.o"
+isPresent "zstd_decompress.o"
+isPresent "zdict.o"
+isPresent "zstd_v07.o"
+mustBeAbsent "zbuff_compress.o"
+$RM $DIR/../lib/libzstd.a tmplog