From 2012e4de9e2c33a5abb34d40082afc8918852c6e Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 10 May 2017 14:51:09 -0700 Subject: fixed c_standards tests and added entry "make list" --- Makefile | 24 ++++++++++++++---------- tests/frametest.c | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 24328d5..b31ebd0 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,10 @@ endif default: lib lz4-release .PHONY: all -all: default examples manuals +all: allmost manuals + +.PHONY: allmost +allmost: lib lz4 examples .PHONY: lib lib: @@ -68,7 +71,7 @@ lz4 lz4-release: lib @cp $(PRGDIR)/lz4$(EXT) . .PHONY: examples -examples: lib lz4-release +examples: lib lz4 $(MAKE) -C $(EXDIR) test .PHONY: manuals @@ -116,6 +119,10 @@ endif #------------------------------------------------------------------------ ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +.PHONY: list +list: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + .PHONY: test test: $(MAKE) -C $(TESTDIR) $@ @@ -166,13 +173,10 @@ gpptest32: clean CC=g++ $(MAKE) -C $(TESTDIR) native CFLAGS="-m32 -O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" c_standards: clean - $(MAKE) all MOREFLAGS="-std=gnu90 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=c99 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=gnu99 -Werror" - $(MAKE) clean - $(MAKE) all MOREFLAGS="-std=c11 -Werror" - $(MAKE) clean + # note : lz4 is not C90 compatible, because it requires long long support + CFLAGS="-std=gnu90 -Werror" $(MAKE) clean allmost + CFLAGS="-std=c99 -Werror" $(MAKE) clean allmost + CFLAGS="-std=gnu99 -Werror" $(MAKE) clean allmost + CFLAGS="-std=c11 -Werror" $(MAKE) clean allmost endif diff --git a/tests/frametest.c b/tests/frametest.c index a4c548e..04597a4 100644 --- a/tests/frametest.c +++ b/tests/frametest.c @@ -290,7 +290,8 @@ int basicTests(U32 seed, double compressibility) { size_t nullSize = 0; size_t const fiError = LZ4F_getFrameInfo(dCtx, &fi, ip, &nullSize); if (LZ4F_getErrorCode(fiError) != LZ4F_ERROR_frameHeader_incomplete) { - DISPLAYLEVEL(3, "incorrect error : %s != ERROR_frameHeader_incomplete \n", LZ4F_getErrorName(fiError)); + DISPLAYLEVEL(3, "incorrect error : %s != ERROR_frameHeader_incomplete \n", + LZ4F_getErrorName(fiError)); goto _output_error; } DISPLAYLEVEL(3, " correctly failed : %s \n", LZ4F_getErrorName(fiError)); -- cgit v0.12