automake
[Top][All Lists]
Advanced

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

running tests in parallel


From: Jason Kraftcheck
Subject: running tests in parallel
Date: Wed, 07 Feb 2007 11:32:35 -0600
User-agent: Icedove 1.5.0.9 (X11/20061220)

It would be nice if it were possible to run tests in parallel using
automake.  Waiting for tests to complete on a 4-way box while they are run
on a single CPU is annoying.  As most 'make' implementations already
support running in parallel (-j), automake could just utilize this
functionality to runt tests in parallel.

The following demonstrates the concept, although it contains some gnu-make
specific syntax and leaves out lots of other automake stuff (e.g. subdirs).

AM_CHECK_RESULTS = $(TESTS:%=am_%.out)
check:
        @rm $(AM_CHECK_RESULTS)
        $(MAKE) check-new

check-new: $(AM_CHECK_RESULTS)
        @total=0; failed=0; \
        for file in $(AM_CHECK_RESULTS); do \
          total=`expr $$total + 1`; \
          if test -f $$file; then \
            val=`cat $$file`; \
            failed=`expr $$failed + $$val`; \
            rm $$file; \
          else \
            failed=`expr $$failed + 1`; \
          fi ; \
        done; \
        echo "*****************************************"; \
        if test $$failed -gt 0; then \
          echo "* $$failed of $$total tests failed"; \
        else \
          echo "* $$total tests passed"; \
        fi; \
        echo "*****************************************";

am_%.out: %
        @if $(TESTS_ENVIRONMENT) $<; then \
          echo "***** $< : SUCCESS"; \
          echo "0" > $@ ; \
        else \
          echo "***** $< : FAILURE"; \
          echo "1" > $@ ; \
        fi




reply via email to

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