summaryrefslogtreecommitdiff
path: root/test/make-cairo-test-constructors.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/make-cairo-test-constructors.sh')
-rw-r--r--test/make-cairo-test-constructors.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
new file mode 100644
index 000000000..cb1391e73
--- /dev/null
+++ b/test/make-cairo-test-constructors.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+if test $# -eq 0; then
+ echo "$0: no input files." >&2
+ exit 0
+fi
+
+cat <<HERE
+/* WARNING: Autogenerated file - see $0! */
+
+#include "cairo-test-private.h"
+
+void _cairo_test_runner_register_tests (void);
+
+HERE
+
+cat "$@" | sed '/^CAIRO_TEST/!d; s/CAIRO_TEST.*(\(.*\),.*/extern void _register_\1 (void);/'
+cat <<HERE
+
+void
+_cairo_test_runner_register_tests (void)
+{
+HERE
+
+cat "$@" | sed '/^CAIRO_TEST/!d; s/CAIRO_TEST.*(\(.*\),.*/ _register_\1 ();/'
+
+echo "}"
+
+