Running the test suite with the autotools build system #423

Open
opened 2026-01-29 20:43:37 +00:00 by claunia · 0 comments
Owner

Originally created by @ryandesign on GitHub (May 7, 2022).

Is it intended to be able to run the test suite when using the undocumented autotools build system?

After running ./bootstrap and ./configure and make I ran make check but got:

make: Nothing to be done for `check'.

and trying make test I got:

make: *** No rule to make target `test'.  Stop.

I see that there is a tests directory with a Makefile in it, but I tried make -C tests test and got:

make[1]: `brotli' is up to date.
./compatibility_test.sh
Testing decompression of file tests/testdata/*.compressed*
bin/tmp/*.uncompressed
./compatibility_test.sh: line 19: bin/brotli: No such file or directory
make: *** [test] Error 127

If I use this patch then make -C tests test works:

--- tests/compatibility_test.sh.orig	2020-08-27 09:12:55.000000000 -0500
+++ tests/compatibility_test.sh	2022-05-07 08:01:14.000000000 -0500
@@ -7,10 +7,13 @@
 
 set -o errexit
 
+cd "$(dirname "${BASH_SOURCE[0]}")/.."
+
 BROTLI_WRAPPER=$1
-BROTLI="${BROTLI_WRAPPER} bin/brotli"
-TMP_DIR=bin/tmp
+BROTLI="${BROTLI_WRAPPER} ./brotli"
+TMP_DIR=tmp
 
+mkdir -p "$TMP_DIR"
 for file in tests/testdata/*.compressed*; do
   echo "Testing decompression of file $file"
   expected=${file%.compressed*}
--- tests/roundtrip_test.sh.orig	2020-08-27 09:12:55.000000000 -0500
+++ tests/roundtrip_test.sh	2022-05-07 08:01:14.000000000 -0500
@@ -6,9 +6,11 @@
 
 set -o errexit
 
+cd "$(dirname "${BASH_SOURCE[0]}")/.."
+
 BROTLI_WRAPPER=$1
-BROTLI="${BROTLI_WRAPPER} bin/brotli"
-TMP_DIR=bin/tmp
+BROTLI="${BROTLI_WRAPPER} ./brotli"
+TMP_DIR=tmp
 INPUTS="""
 tests/testdata/alice29.txt
 tests/testdata/asyoulik.txt
@@ -19,6 +21,7 @@
 c/dec/decode.c
 """
 
+mkdir -p "$TMP_DIR"
 for file in $INPUTS; do
   if [ -f $file ]; then
     for quality in 1 6 9 11; do
make[1]: `brotli' is up to date.
./compatibility_test.sh
Testing decompression of file tests/testdata/empty.compressed
tmp/empty.uncompressed
Testing decompression of file tests/testdata/ukkonooa.compressed
tmp/ukkonooa.uncompressed
./roundtrip_test.sh
Roundtrip testing c/enc/encode.c at quality 1
Roundtrip testing c/enc/encode.c at quality 6
Roundtrip testing c/enc/encode.c at quality 9
Roundtrip testing c/enc/encode.c at quality 11
Roundtrip testing c/common/dictionary.h at quality 1
Roundtrip testing c/common/dictionary.h at quality 6
Roundtrip testing c/common/dictionary.h at quality 9
Roundtrip testing c/common/dictionary.h at quality 11
Roundtrip testing c/dec/decode.c at quality 1
Roundtrip testing c/dec/decode.c at quality 6
Roundtrip testing c/dec/decode.c at quality 9
Roundtrip testing c/dec/decode.c at quality 11

however I don't know if that change should be necessary or if I'm missing something.

Maybe what I'm missing is that tests/Makefile is intended to work with the non-autotools Makefile that brotli ships with? If so, maybe instead of modifying tests/Makefile the check target should get some new code so that make check does something equivalent?

Originally created by @ryandesign on GitHub (May 7, 2022). Is it intended to be able to run the test suite when using the undocumented autotools build system? After running `./bootstrap` and `./configure` and `make` I ran `make check` but got: ``` make: Nothing to be done for `check'. ``` and trying `make test` I got: ``` make: *** No rule to make target `test'. Stop. ``` I see that there is a tests directory with a Makefile in it, but I tried `make -C tests test` and got: ``` make[1]: `brotli' is up to date. ./compatibility_test.sh Testing decompression of file tests/testdata/*.compressed* bin/tmp/*.uncompressed ./compatibility_test.sh: line 19: bin/brotli: No such file or directory make: *** [test] Error 127 ``` If I use this patch then `make -C tests test` works: ```diff --- tests/compatibility_test.sh.orig 2020-08-27 09:12:55.000000000 -0500 +++ tests/compatibility_test.sh 2022-05-07 08:01:14.000000000 -0500 @@ -7,10 +7,13 @@ set -o errexit +cd "$(dirname "${BASH_SOURCE[0]}")/.." + BROTLI_WRAPPER=$1 -BROTLI="${BROTLI_WRAPPER} bin/brotli" -TMP_DIR=bin/tmp +BROTLI="${BROTLI_WRAPPER} ./brotli" +TMP_DIR=tmp +mkdir -p "$TMP_DIR" for file in tests/testdata/*.compressed*; do echo "Testing decompression of file $file" expected=${file%.compressed*} --- tests/roundtrip_test.sh.orig 2020-08-27 09:12:55.000000000 -0500 +++ tests/roundtrip_test.sh 2022-05-07 08:01:14.000000000 -0500 @@ -6,9 +6,11 @@ set -o errexit +cd "$(dirname "${BASH_SOURCE[0]}")/.." + BROTLI_WRAPPER=$1 -BROTLI="${BROTLI_WRAPPER} bin/brotli" -TMP_DIR=bin/tmp +BROTLI="${BROTLI_WRAPPER} ./brotli" +TMP_DIR=tmp INPUTS=""" tests/testdata/alice29.txt tests/testdata/asyoulik.txt @@ -19,6 +21,7 @@ c/dec/decode.c """ +mkdir -p "$TMP_DIR" for file in $INPUTS; do if [ -f $file ]; then for quality in 1 6 9 11; do ``` ``` make[1]: `brotli' is up to date. ./compatibility_test.sh Testing decompression of file tests/testdata/empty.compressed tmp/empty.uncompressed Testing decompression of file tests/testdata/ukkonooa.compressed tmp/ukkonooa.uncompressed ./roundtrip_test.sh Roundtrip testing c/enc/encode.c at quality 1 Roundtrip testing c/enc/encode.c at quality 6 Roundtrip testing c/enc/encode.c at quality 9 Roundtrip testing c/enc/encode.c at quality 11 Roundtrip testing c/common/dictionary.h at quality 1 Roundtrip testing c/common/dictionary.h at quality 6 Roundtrip testing c/common/dictionary.h at quality 9 Roundtrip testing c/common/dictionary.h at quality 11 Roundtrip testing c/dec/decode.c at quality 1 Roundtrip testing c/dec/decode.c at quality 6 Roundtrip testing c/dec/decode.c at quality 9 Roundtrip testing c/dec/decode.c at quality 11 ``` however I don't know if that change should be necessary or if I'm missing something. Maybe what I'm missing is that tests/Makefile is intended to work with the non-autotools Makefile that brotli ships with? If so, maybe instead of modifying tests/Makefile the check target should get some new code so that `make check` does something equivalent?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#423