[Top][All Lists]

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

non-recursive make and tests

From: Bob Friesenhahn
Subject: non-recursive make and tests
Date: Mon, 30 Aug 2004 10:01:26 -0500 (CDT)

I have spent the weekend working on converting a large package (GraphicsMagick) to use a single Makefile (actually a top with subordinate includes). Progress has gone very well. All targets are properly built and installed. It takes only half a second for make to decide there is nothing to do.

Unfortunately, the most difficult part of converting to a single Makefile remains. That difficult part is the test suite. When using a single Makefile, the default directory is the top of the build directory. Test scripts and programs usually prefer to be executed in the directory where the test script or program resides since it is useful for any output (including core files) to be written in the same directory as the test. When execting tests, $srcdir is set to the top of the source tree ($top_srcdir) rather than a relative position. To make matters worse, $srcdir is often set to something relatively useless like '.' or '..' so it is difficult to make sense of it.

Since the starting point for tests is always the top of the build directory, test scripts and programs become infected with commands to cd to the test directory. They also become infected with code to evaluate the actual relative srcdir so they can find their input files. This makes developing a test suite which passes the distcheck tests much more difficult.

It would be quite helpful if Automake offered a mode in which it automatically changed the working directory to the directory where the test program/script resides and set $srcdir to the relative position in the source tree to support VPATH builds. This would emulate the operation of recursive builds. Either a global Automake option could be used to enable this (subdir-tests), or a "RTESTS" (relative tests) mode would be provided.

What would it take to make this happen?

Bob Friesenhahn

reply via email to

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