[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bracketing a "check" target with pre and post actions
From: |
Ralf Wildenhues |
Subject: |
Re: Bracketing a "check" target with pre and post actions |
Date: |
Sun, 20 Jul 2008 21:32:04 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
* Bernd Jendrissek wrote on Mon, Jul 14, 2008 at 02:49:46PM CEST:
> I need to run my testsuite against a PostgreSQL database that I want
> predictably populated with data straight from the source tree, so that
> code version 17 gets tested against data version 17. How can I teach
> automake to set up the database before running the testsuite, and to
> clean it up afterwards?
> .PHONY: fat-check
> fat-check: check
> echo "drop database foo;" |psql postgres $(dbsuperuser)
>
> check-local:
> echo "create database foo;" |psql postgres $(dbsuperuser)
> psql $(dbname) $(dbuser) -f $(top_srcdir)/whatever/dump.sql
Why not do it all in check-local?
check-local:
echo "create database foo;" |psql postgres $(dbsuperuser)
psql $(dbname) $(dbuser) -f $(top_srcdir)/whatever/dump.sql
echo "drop database foo;" |psql postgres $(dbsuperuser)
Or do you have a TESTS=... testsuite, rather than the second command
being your testsuite?
Cheers,
Ralf