]> git.draconx.ca Git - dxcommon.git/blobdiff - t/autotest.sh
Add missing file for autotest snippet test.
[dxcommon.git] / t / autotest.sh
diff --git a/t/autotest.sh b/t/autotest.sh
new file mode 100755 (executable)
index 0000000..d563ab2
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Copyright © 2022 Nick Bowler
+#
+# Fake autotest program for testing the autotest snippets.
+#
+# License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+# This is free software: you are free to do what the fuck you want to.
+# There is NO WARRANTY, to the extent permitted by law.
+
+argv0=$0
+
+outfile=
+for arg
+do
+  arg=${lastarg:+"$lastarg="}$arg
+  lastarg=
+
+  save_IFS=$IFS; IFS='='
+  set x $arg; shift; shift; optarg=$*
+  IFS=$save_IFS
+
+  case $arg in
+  -o|--output) lastarg=--output ;;
+  --output=*) outfile=$optarg ;;
+  esac
+done
+
+test x"$outfile" = x || exec 1>"$outfile"