-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've got a simple unit test scenario - I want to run my program and verify some text on its single output line. In a makefile, I might do this:
check: myprog | grep "myprog text" @echo PASSED! In Automake, what's the simplest way to do this? I've found this way: EXTRA_DIST = greptest.sh TESTS = greptest.sh But this requires me to: 1) Actually HAVE a one-line script file called "greptest.sh" as part of my package. 2) Use the EXTRA_DIST line. Why is this? Can't Automake tell from the TESTS line that this is a file I need in my distribution? In my experiments, I've also discovered this method: TESTS_ENVIRONMENT = $(SHELL) TESTS = greptest.sh greptest.sh: echo 'myprog | grep "myprog text"' > greptest.sh clean-local: -rm greptest.sh But this seems overly complex for a one-liner. In addition, I had to add the TESTS_ENVIRONMENT line because I could NOT get chmod to set greptest.sh to executable. The make utility just seemed to ignore the command, if I added it after the echo line. The clean-local line was necessary in this case because "make distcheck" complains that greptest.sh was left lying around, and the "-" in front of "rm" was necessary because otherwise "make clean" will fail if "make check" isn't run first. Anyone know of a more concise way of doing this? Frankly, I'd like to just run the script inline somewhere, but I can't see a way to do it with Automake. It wants all TESTS to be real files. Thanks, John -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFILfX4dcgqmRY/OH8RAsSPAJ4/q1yaj4REwuqJgH5GKyV3ywBZzgCfUfw9 fHr/e/1kvwJzC+DVHDUZZyc= =eJNi -----END PGP SIGNATURE-----