6 # Tests for installed() with hopefully proper exit codes (1 if the program was
8 installed ls && echo ls installed
9 installed doesnt-exist && echo doesnt-exist installed
11 # Simulate BSD `which` like on Mac OS X which doesn't use exit codes.
13 echo Mac OS X which for $1 >&2
17 echo no doesnt-exist in /usr/bin /bin /usr/sbin /sbin
20 # Tests for installed() without exit codes.
21 installed ls && echo ls installed
22 installed doesnt-exist && echo doesnt-exist installed
26 echo "Simple test file for m4.
34 # Remove the line with the current date as it changes every time.
35 cat tmp/test | grep -v "It was generated from tmp/test.m4"
37 # Test multiple arguments to m4().
38 echo "Test with multiple arguments passed to m4.
41 " > tmp/test-multiple.m4
42 m4 tmp/test-multiple -DFIRST=first -DSECOND=second
43 # Remove the line with the current date as it changes every time.
44 cat tmp/test-multiple | grep -v "It was generated from tmp/test-multiple.m4"
46 # Test multiple arguments with spaces to m4().
47 echo "Test with multiple arguments with spaces passed to m4.
50 " > tmp/test-multiple-spaces.m4
51 m4 tmp/test-multiple-spaces -DFIRST="first with spaces" \
52 -DSECOND="second with spaces"
53 # Remove the line with the current date as it changes every time.
54 cat tmp/test-multiple-spaces \
55 | grep -v "It was generated from tmp/test-multiple-spaces.m4"