]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Get ready to add tests to travis-ci
authorNick Terrell <terrelln@fb.com>
Thu, 1 Sep 2016 23:21:19 +0000 (16:21 -0700)
committerNick Terrell <terrelln@fb.com>
Thu, 1 Sep 2016 23:21:19 +0000 (16:21 -0700)
.gitignore
contrib/pzstd/Makefile
contrib/pzstd/test/Makefile
contrib/pzstd/utils/test/Makefile

index 5f2ca97deff99bdb1afe36f66a0eb7d8cede906f..13b61972cf02734f906a47deea2e414e577198ae 100644 (file)
@@ -30,3 +30,4 @@ _zstdbench/
 *.idea
 *.swp
 .DS_Store
+googletest/
index 512a76292325dcd2fa2d229a8c5537239a626bf2..ba86f5d4d6a1ea4298aa34dff1c81cb2b0f25cc8 100644 (file)
@@ -59,6 +59,11 @@ main.o: main.cpp *.h utils/*.h
 pzstd: libzstd.a Pzstd.o SkippableFrame.o Options.o main.o
        $(CXX) $(FLAGS) $^ -o $@$(EXT)
 
+googletest:
+       @git clone https://github.com/google/googletest
+       @mkdir -p googletest/build
+       @cd googletest/build && cmake .. && make
+
 test: libzstd.a Pzstd.o Options.o SkippableFrame.o
        $(MAKE) -C utils/test test
        $(MAKE) -C test test
@@ -67,5 +72,5 @@ clean:
        $(MAKE) -C $(ZSTDDIR) clean
        $(MAKE) -C utils/test clean
        $(MAKE) -C test clean
-       @$(RM) libzstd.a *.o pzstd$(EXT)
+       @$(RM) -rf googletest/ libzstd.a *.o pzstd$(EXT)
        @echo Cleaning completed
index 3b0ffec89178a0f065837034e2c9082da56675dd..147d9bd79527c830ecd1cdcf1e097bceddbe39da 100644 (file)
@@ -7,10 +7,6 @@
 # of patent rights can be found in the PATENTS file in the same directory.
 # ##########################################################################
 
-# Set GTEST_INC and GTEST_LIB to work with your install of gtest
-GTEST_INC ?= -isystem googletest/googletest/include
-GTEST_LIB ?= -L googletest/build/googlemock/gtest
-
 # Define *.exe as extension for Windows systems
 ifneq (,$(filter Windows%,$(OS)))
 EXT =.exe
@@ -22,6 +18,10 @@ PZSTDDIR = ..
 PROGDIR = ../../../programs
 ZSTDDIR = ../../../lib
 
+# Set GTEST_INC and GTEST_LIB to work with your install of gtest
+GTEST_INC ?= -isystem $(PZSTDDIR)/googletest/googletest/include
+GTEST_LIB ?= -L $(PZSTDDIR)/googletest/build/googlemock/gtest
+
 CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB) -I$(ZSTDDIR)/common -I$(PROGDIR)
 
 CFLAGS  ?= -O3
@@ -37,9 +37,11 @@ datagen.o: $(PROGDIR)/datagen.*
 
 .PHONY: test clean
 
-test: OptionsTest PzstdTest RoundTripTest
+test: OptionsTest PzstdTest
        @./OptionsTest$(EXT)
        @./PzstdTest$(EXT)
+
+roundtrip: RoundTripTest
        @./RoundTripTest$(EXT)
 
 clean:
index 4c69063308e59b5fc324399238356cbda56956b1..6f801c309c02f1e3f559f588cbeb0bee9b5a7c83 100644 (file)
@@ -7,9 +7,6 @@
 # of patent rights can be found in the PATENTS file in the same directory.
 # ##########################################################################
 
-GTEST_INC ?= -isystem googletest/googletest/include
-GTEST_LIB ?= -L googletest/build/googlemock/gtest
-
 # Define *.exe as extension for Windows systems
 ifneq (,$(filter Windows%,$(OS)))
 EXT =.exe
@@ -19,6 +16,10 @@ endif
 
 PZSTDDIR = ../..
 
+# Set GTEST_INC and GTEST_LIB to work with your install of gtest
+GTEST_INC ?= -isystem $(PZSTDDIR)/googletest/googletest/include
+GTEST_LIB ?= -L $(PZSTDDIR)/googletest/build/googlemock/gtest
+
 CPPFLAGS = -I$(PZSTDDIR) $(GTEST_INC) $(GTEST_LIB)
 CFLAGS  ?= -O3
 CFLAGS  += -std=c++11