Igalia / pflua

Packet filtering in Lua
Other
313 stars 39 forks source link

tests/Makefile: finish download before running tests (fixes #244) #245

Closed curiousleo closed 9 years ago

curiousleo commented 9 years ago

With parallel builds enabled (e.g. via make -j 4 check or MAKEFLAGS set to '-j 4'), the "tests" makefile schedules the download of data/wingolog.pcap in parallel with the tests that depend on that file (issue #244). This commit restricts the parallelism in tests/Makefile to prevent this.

The following targets in tests/Makefile depend on data/wingolog.pcap:

With parallel builds enabled, prior to this commit make $TARGET with $TARGET set to any of the targets listed above is likely to fail if data/wingolog.pcap has not been downloaded yet.

Using a trick taken from http://stackoverflow.com/a/8496739/3507119 the download is forced to happen before any of the rules of the above targets are executed. Instead of listing the download target $TEST_SAVEFILE_URL as a prerequisite, the command

$(MAKE) $(TEST_SAVEFILE_URL)

has been prepended to each of the targets listed above. Now any of them can be executed with parallel builds enabled.

I did not prepend this command to the rule for $IR_REGRESSION_TESTS and $PFLANG_REGRESSION_TESTS because that seemed like overkill. Anyone who executes a particular regression test directly probably already has data/wingolog.pcap or will be able to read the error message that comes up when that file is missing.

kbara commented 9 years ago

LGTM, thank you! Sorry for taking a few days to reply.