summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-15 13:26:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-15 13:26:34 +0100
commit1caa34103925c53b180cd614f5c6b425b5a3f271 (patch)
tree02e974f51fee963907cd0da1ab298274ae7d46a0 /test
parent818ad38a0e323892231469520a4b077f4dae31d4 (diff)
Fix build under distcheck
Need to play a little dance to get the sources included and paths correct whilst building source files with objdir != srcdir under distcheck.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am9
-rw-r--r--test/make-cairo-test-constructors.c13
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);