summaryrefslogtreecommitdiff
path: root/test/make-cairo-test-constructors.sh
blob: fdb84e9dc3d7dbeddb9717ecd19e82a877f85400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/sh

if test $# == 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 "}"