automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parallel builds with some ordering constraints


From: Nick Bowler
Subject: Re: Parallel builds with some ordering constraints
Date: Sat, 29 Dec 2018 16:10:14 -0500

Hello,

On 2018-12-29, Kip Warner <address@hidden> wrote:
> Parallel builds work fine for my build tree of a system daemon I am
> developing. I have unit tests in the form of check_SCRIPTS and
> check_PROGRAMS.
>
> These unit tests, however, can only be partially parallelized because
> there needs to be some ordering constraints.

OK, I am assuming you are using the Automake parallel-tests feature.

> I have a unit test in check_SCRIPTS which starts the daemon via init.d.
> The daemon writes out a pid file. There is another unit test script to
> stop it via init.d.
[...]
> For ensuring the stop daemon script at least runs after the start
> script when make computes the dependency graph, I have a (working)
> hack. I simply make the stop daemon target shell script depend on the
> test log of the start script. This works, but it could break in the
> future with newer Automakes.
>
> But in any event, I still don't know what I can do for the binary
> check_PROGRAMS that test the daemon itself to constrain them to run
> between the former two?

So there's no problem with building the programs, the issue is just in
the execution order of the test cases?  You have one test case which
must run before all other test cases, and one test case which must run
after all other test cases.

The documented method to ensure ordering between two (or more) test
cases in the parallel test harness is to put explicit make prerequisites
between the log files[1], e.g. (totally untested):

  all_tests_except_start = test1.log test2.log test3.log test-stop.log
  all_tests_except_stop = test-start.log test1.log test2.log test3.log

  $(all_tests_except_start): test-start.log
  test-stop.log: $(all_tests_except_stop)

[1] 
https://www.gnu.org/software/automake/manual/automake.html#Parallel-Test-Harness

Hope that helps,
  Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]