]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add basic tests for the lz4 integration
authorW. Felix Handte <w@felixhandte.com>
Fri, 22 Sep 2017 00:30:43 +0000 (17:30 -0700)
committerW. Felix Handte <w@felixhandte.com>
Thu, 28 Sep 2017 23:16:43 +0000 (19:16 -0400)
.travis.yml
Makefile
tests/Makefile

index a52d57af3edd8e82a097c9b2ed41c85df97f3d8f..26aeab90ce47002563c04fad6d9f326879a6adaf 100644 (file)
@@ -22,6 +22,8 @@ matrix:
     - env: Cmd='make ppcinstall && make ppcfuzz'
     - env: Cmd='make ppcinstall && make ppc64fuzz'
 
+    - env: Cmd='make lz4install && make -C tests test-lz4'
+
 git:
   depth: 1
 
index e8bdcea331744417fbd840f8b952804091555427..13e8250218d5e2e1884be4621e8b6de2da00a00f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -97,6 +97,7 @@ clean:
        @$(MAKE) -C examples/ $@ > $(VOID)
        @$(MAKE) -C contrib/gen_html $@ > $(VOID)
        @$(RM) zstd$(EXT) zstdmt$(EXT) tmp*
+       @$(RM) -r lz4
        @echo Cleaning completed
 
 #------------------------------------------------------------------------------
@@ -274,6 +275,10 @@ gpp6install: apt-add-repo
 clang38install:
        APT_PACKAGES="clang-3.8" $(MAKE) apt-install
 
+# Ubuntu 14.04 ships a too-old lz4
+lz4install:
+       [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install
+
 endif
 
 
index 2746c13925a9105ad75c31bd1d236e4d5465e278..f30398c06f227ef07075f8378cbdfc6a7ffb3600 100644 (file)
@@ -374,4 +374,26 @@ test-decodecorpus-cli: decodecorpus
 test-pool: poolTests
        $(QEMU_SYS) ./poolTests
 
+test-lz4: ZSTD = LD_LIBRARY_PATH=/usr/local/lib $(PRGDIR)/zstd
+test-lz4: zstd decodecorpus
+       ./decodecorpus -ptmp
+       # lz4 -> zstd
+       lz4 < tmp | \
+       $(ZSTD) -d | \
+       cmp - tmp
+       # zstd -> lz4
+       $(ZSTD) --format=lz4 < tmp | \
+       lz4 -d | \
+       cmp - tmp
+       # zstd -> zstd
+       $(ZSTD) --format=lz4 < tmp | \
+       $(ZSTD) -d | \
+       cmp - tmp
+       # zstd -> zstd
+       $(ZSTD) < tmp | \
+       $(ZSTD) -d | \
+       cmp - tmp
+
+       rm tmp
+
 endif