From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Meeuwissen Subject: Re: Temp files from testing are permanent... Date: Thu, 16 Feb 2012 09:54:10 +0900 Message-ID: <8762f7d2dp.fsf@avasys.jp> References: <8762f9w9l3.fsf@Rainer.invalid> <87sjidovpo.fsf@avasys.jp> <877gzof2e1.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxpcA-0003NG-4W for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 19:54:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxpc4-0000Hk-Bg for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 19:54:25 -0500 Received: from ekc4.avasys.jp ([210.228.20.165]:45963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxpc4-0000FM-23 for emacs-orgmode@gnu.org; Wed, 15 Feb 2012 19:54:20 -0500 In-Reply-To: <877gzof2e1.fsf@Rainer.invalid> (Achim Gratz's message of "Wed, 15 Feb 2012 18:11:02 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org Achim Gratz writes: > Olaf Meeuwissen writes: >> If running `make check` (or similar) creates these files, `make clean` >> (or similar) should clean them up. > > I was asking that question to decide whether I do need to extend my > Makefile fork to handle the cleanup or if the testsuite needs to be > called differently to avoid leaving these stale files. If you'd take a > look, you can see that the files are obviously made with a function that > ensures they're unique, most likely make-temp-file. If so, it would > seem logical that the testsuite should remove them after each test > (since it is the only instance to know the complete filename). It would > also seem logical that for debugging purposes one could leave the files > around. Successful tests can clean up after themselves but failed tests should not so you can debug. The decision to remove these files should be left to whoever runs the test suite. That implies that even successful tests don't really have to bother cleaning up after themselves. I normally instruct my tests to create files in a dedicated directory with a fixed name somewhere below $(top_builddir). Then a `make clean` can just remove the whole directory. If you use `make check` to run the test suite, you can easily set TMPDIR via the TESTS_ENVIRONMENT Makefile variable (assuming that that variable is taken into account when making unique file names). Something like TESTS_ENVIRONMENT = TMPDIR=$(builddir)/test-outputs and then add a clean-local target like clean-local: -rm -rf $(builddir)/test-outputs See [[info:automake-1.11#Simple%20Tests][info:automake-1.11#Simple Tests]] and [[info:automake-1.11#Extending]] for details. Hope this helps, -- Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION FSF Associate Member #1962 Help support software freedom http://www.fsf.org/jf?referrer=1962