installed ls && echo ls installed
installed doesnt-exist && echo doesnt-exist installed
+# Tests for m4().
+echo "Simple test file for m4.
+IF(TEST,m4)
+ m4
+FI
+IF(TEST,n4)
+ n4
+FI" > tmp/test.m4
+m4 tmp/test -DTEST=m4
+# Remove the line with the current date as it changes every time.
+cat tmp/test | grep -v "It was generated from tmp/test.m4"
+
# vim: ft=sh
Mac OS X which for ls
ls installed
Mac OS X which for doesnt-exist
+m4(): generating 'tmp/test' from 'tmp/test.m4' with options '-DTEST=m4'
+###################################
+# WARNING! DO NOT EDIT THIS FILE! #
+###################################
+
+
+Simple test file for m4.
+ m4
# Get all test files.
for file in *.test; do
+ # Create temporary directory.
+ mkdir -p tmp
+
# Run the test file in sh and zsh and get its output.
sh $file > $file.out.sh 2>&1
zsh $file > $file.out.zsh 2>&1
# code 1.
diff -u -N $file.out $file.out.sh || exit 1
diff -u -N $file.out $file.out.zsh || exit 1
+
+ # Remove temporary directory.
+ rm -rf tmp
done
# Remove all temporary files.
-rm -rf tmp
rm *.out.sh
rm *.out.zsh