summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.gitignore1
-rw-r--r--tests/config-flags.pm.in18
-rw-r--r--tests/run_make_tests.pl1
-rw-r--r--tests/scripts/features/load12
-rw-r--r--tests/scripts/features/loadapi10
5 files changed, 36 insertions, 6 deletions
diff --git a/tests/.gitignore b/tests/.gitignore
index b8f99f5..a30a689 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1 +1,2 @@
+config-flags.pm
work
diff --git a/tests/config-flags.pm.in b/tests/config-flags.pm.in
new file mode 100644
index 0000000..a26b8dc
--- /dev/null
+++ b/tests/config-flags.pm.in
@@ -0,0 +1,18 @@
+# This is a -*-perl-*- script
+#
+# Set variables that were defined by configure, in case we need them
+# during the tests.
+
+%CONFIG_FLAGS = (
+ AM_LDFLAGS => '@AM_LDFLAGS@',
+ CC => '@CC@',
+ CFLAGS => '@CFLAGS@',
+ CPP => '@CPP@',
+ CPPFLAGS => '@CPPFLAGS@',
+ GUILE_CFLAGS => '@GUILE_CFLAGS@',
+ GUILE_LIBS => '@GUILE_LIBS@',
+ LDFLAGS => '@LDFLAGS@',
+ LIBS => '@LIBS@'
+);
+
+1;
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 54c2892..555e409 100644
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -43,6 +43,7 @@ $command_string = '';
$all_tests = 0;
require "test_driver.pl";
+require "config-flags.pm";
# Some target systems might not have the POSIX module...
$has_POSIX = eval { require "POSIX.pm" };
diff --git a/tests/scripts/features/load b/tests/scripts/features/load
index 2e3f263..05e9ddb 100644
--- a/tests/scripts/features/load
+++ b/tests/scripts/features/load
@@ -6,8 +6,6 @@ $details = "Test dynamic loading of modules.";
# Don't do anything if this system doesn't support "load"
exists $FEATURES{load} or return -1;
-my $sobuild = '$(CC) '.($srcdir? "-I$srcdir":'').' -g -shared -fPIC -o $@ $<';
-
# First build a shared object
# Provide both a default and non-default load symbol
@@ -39,7 +37,15 @@ EOF
close($F) or die "close: testload.c: $!\n";
# Make sure we can compile
-run_make_test('testload.so: testload.c ; @'.$sobuild, '', '');
+# CONFIG_FLAGS are loaded from config-flags.pm and set by configure
+
+my $sobuild = "$CONFIG_FLAGS{CC} ".($srcdir? "-I$srcdir":'')." $CONFIG_FLAGS{CPPFLAGS} $CONFIG_FLAGS{CFLAGS} -shared -fPIC $CONFIG_FLAGS{LDFLAGS} -o testload.so testload.c";
+
+my $clog = `$sobuild 2>&1`;
+if ($? != 0) {
+ $verbose and print "Failed to build testload.so:\n$sobuild\n$_";
+ return -1;
+}
# TEST 1
run_make_test(q!
diff --git a/tests/scripts/features/loadapi b/tests/scripts/features/loadapi
index 6d3b03f..bf66bae 100644
--- a/tests/scripts/features/loadapi
+++ b/tests/scripts/features/loadapi
@@ -6,8 +6,6 @@ $details = "Verify the different aspects of the shared object API.";
# Don't do anything if this system doesn't support "load"
exists $FEATURES{load} or return -1;
-my $sobuild = '$(CC) '.($srcdir? "-I$srcdir":'').' -g -shared -fPIC -o $@ $<';
-
# First build a shared object
# Provide both a default and non-default load symbol
@@ -74,7 +72,13 @@ testapi_gmk_setup ()
EOF
close($F) or die "close: testapi.c: $!\n";
-run_make_test('testapi.so: testapi.c ; @'.$sobuild, '', '');
+my $sobuild = "$CONFIG_FLAGS{CC} ".($srcdir? "-I$srcdir":'')." $CONFIG_FLAGS{CPPFLAGS} $CONFIG_FLAGS{CFLAGS} -shared -fPIC $CONFIG_FLAGS{LDFLAGS} -o testapi.so testapi.c";
+
+my $clog = `$sobuild 2>&1`;
+if ($? != 0) {
+ $verbose and print "Failed to build testapi.so:\n$sobuild\n$_";
+ return -1;
+}
# TEST 1
# Check the gmk_expand() function