diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 9 | ||||
-rw-r--r-- | test/make-cairo-test-constructors.c | 13 |
2 files changed, 14 insertions, 8 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 3b5f89580..887cd10ad 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -70,10 +70,10 @@ test_sources += $(test) TESTS += cairo-test-suite$(EXEEXT) make-cairo-test-constructors$(EXEEXT): make-cairo-test-constructors.c - $(CC) -o $@ make-cairo-test-constructors.c + $(CC) $^ -o $@ cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors$(EXEEXT) - (cd $(srcdir) && ./make-cairo-test-constructors$(EXEEXT) $(test_sources)) > $@ + ./make-cairo-test-constructors$(EXEEXT) $(srcdir) $(test_sources) > $@ cairo_test_suite_SOURCES = \ $(cairo_test_suite_sources) \ @@ -121,9 +121,8 @@ cairo_test_trace_DEPENDENCIES = \ endif BUILT_SOURCES += cairo-test-constructors.c -EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING -CLEANFILES += $(BUILT_SOURCES) -CLEANFILES += make-cairo-test-constructors +EXTRA_DIST += $(BUILT_SOURCES) $(noinst_SCRIPTS) COPYING make-cairo-test-constructors.c +CLEANFILES += $(BUILT_SOURCES) make-cairo-test-constructors # All tests which have a reference image go here. REFERENCE_IMAGES = \ diff --git a/test/make-cairo-test-constructors.c b/test/make-cairo-test-constructors.c index e19de372b..15c647057 100644 --- a/test/make-cairo-test-constructors.c +++ b/test/make-cairo-test-constructors.c @@ -32,6 +32,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <limits.h> #define NAME "make-cairo-test-constructors.c" @@ -115,16 +116,22 @@ scan_file (const char *filename, int main (int argc, char **argv) { + char buf[PATH_MAX]; int i; int fail = 0; struct name *node; - for (i=1; i<argc; i++) { - FILE *fp = fopen (argv[i], "r"); + for (i = 2; i < argc; i++) { + FILE *fp; + + snprintf (buf, sizeof (buf), "%s/%s", argv[1], argv[i]); + + fp = fopen (buf, "r"); if (fp) { fail |= scan_file (argv[i], fp); fclose (fp); - } + } else + fail = 1; } if (fail) exit(1); |