Skip to content

Commit

Permalink
Tweak test Makefile add Circle CI tests for "SLOPPY" build.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevina committed Aug 17, 2019
1 parent d79237e commit 3393c47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ jobs:
#
- run: ./autogen
- run: make -j2 -C test
- run: rm test/build/Makefile
- run: make SLOPPY=1 -j2 -C test

workflows:
version: 2
Expand Down
22 changes: 14 additions & 8 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export ASPELL = ${CURDIR}/inst/bin/aspell
export PREZIP = ${CURDIR}/inst/bin/prezip-bin
MAKE := ${MAKE} "CXXFLAGS=${CXXFLAGS}" "CFLAGS=${CFLAGS}"
EXTRA_CONFIG_FLAGS =
ifdef SLOPPY
EXTRA_CONFIG_FLAGS += --enable-sloppy-null-term-strings
endif

all:: prep sanity filter-test suggest wide cxx_warnings
cat test-res
Expand All @@ -23,7 +26,7 @@ filter-test:: prep
echo "all ok (markdown filter-test)" >> test-res

inst/bin/aspell: build/Makefile phony
$(MAKE) -C build install
$(MAKE) -C build aspell && cmp build/aspell inst/bin/aspell || $(MAKE) -s -C build install

inst/lib/aspell-0.60/en.multi: inst/bin/aspell aspell6-en-2018.04.16-0.tar.bz2
tar xf aspell6-en-2018.04.16-0.tar.bz2
Expand All @@ -36,7 +39,7 @@ inst/lib/aspell-0.60/en.multi: inst/bin/aspell aspell6-en-2018.04.16-0.tar.bz2

build/Makefile:
mkdir -p build
cd build && ../../configure --enable-maintainer-mode --disable-shared --disable-pspell-compatibility --prefix="${CURDIR}/inst" $(EXTRA_CONFIG_FLAGS)
cd build && ../../configure -q --enable-maintainer-mode --disable-shared --disable-pspell-compatibility --prefix="${CURDIR}/inst" $(EXTRA_CONFIG_FLAGS)

aspell6-en-2018.04.16-0.tar.bz2:
curl -O ftp://ftp.gnu.org/gnu/aspell/dict/en/aspell6-en-2018.04.16-0.tar.bz2
Expand All @@ -54,27 +57,30 @@ wide:: wide_test_invalid wide_test_invalid-but_ok wide_test_valid
wide_test_invalid: wide_test_invalid.c prep
$(CC) $(CFLAGS) -Iinst/include -c $< -o tmp/$@.o
$(CXX) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
ifdef SLOPPY
./$@
echo "ok ($@ SLOPPY)" >> test-res
else
./$@ 2> tmp/$@.log || true
fgrep -q 'Null-terminated wide-character strings unsupported when used this way.' tmp/$@.log
echo "ok ($@)" >> test-res
endif

wide_test_valid: wide_test_valid.c prep
$(CC) $(CFLAGS) -Iinst/include -c $< -o tmp/$@.o
$(CXX) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
./$@
echo "ok ($@)" >> test-res

wide_test_invalid-but_ok: wide_test_invalid.c prep
$(CC) $(CFLAGS) -DASPELL_ENCODE_SETTING_SECURE -Iinst/include -c $< -o tmp/$@.o
$(CXX) tmp/$@.o inst/lib/libaspell.a -ldl -o $@
./$@
echo "ok ($@)" >> test-res

cxx_warnings: wide_test_invalid.cpp prep
$(CXX) $(CXXFLAGS) -Wall -Wconversion -Werror -Iinst/include $< inst/lib/libaspell.a -ldl -o $@

## this target is only true if configured with --enable-sloppy-null-term-strings
wide_test_invalid-but_allowed: wide_test_invalid.c prep
$(CC) $(CFLAGS) -Iinst/include -c $< inst/lib/libaspell.a -ldl -o tmp/obj.o
$(CXX) tmp/obj.o inst/lib/libaspell.a -ldl -o $@
./$@
echo "ok ($@)" >> test-res

.PHONY: phony
phony:

0 comments on commit 3393c47

Please sign in to comment.