summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.cvsignore2
-rw-r--r--tests/ChangeLog8
-rwxr-xr-xtests/run_make_tests.pl3
-rw-r--r--tests/scripts/features/archives42
4 files changed, 55 insertions, 0 deletions
diff --git a/tests/.cvsignore b/tests/.cvsignore
index b8f99f5..2fe9187 100644
--- a/tests/.cvsignore
+++ b/tests/.cvsignore
@@ -1 +1,3 @@
work
+.*gdbinit
+.gdb_history
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 650d8d4..5d62930 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-13 Paul Smith <psmith@gnu.org>
+
+ * scripts/features/archives: New regression tests for archive
+ support. Test for fix to Savannah bug #30612.
+
+ * run_make_tests.pl (set_more_defaults): Set a %FEATURES hash to
+ the features available in $(.FEATURES).
+
2010-08-10 Paul Smith <psmith@gnu.org>
* scripts/features/reinvoke: Ensure command line variable settings
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 2c8c08b..7291c55 100755
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -29,6 +29,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
+%FEATURES = ();
$valgrind = 0; # invoke make with valgrind
$valgrind_args = '';
@@ -367,6 +368,8 @@ sub set_more_defaults
$parallel_jobs = 1;
}
+ %FEATURES = map { $_ => 1 } split /\s+/, `sh -c "echo '\\\$(info \\\$(.FEATURES))' | $make_path -f- 2>/dev/null"`;
+
# Set up for valgrind, if requested.
if ($valgrind) {
diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives
new file mode 100644
index 0000000..00aa1af
--- /dev/null
+++ b/tests/scripts/features/archives
@@ -0,0 +1,42 @@
+# -*-mode: perl-*-
+
+$description = "Test GNU make's archive management features.";
+
+$details = "\
+This only works on systems that support it.";
+
+# If this instance of make doesn't support archives, skip it
+exists $FEATURES{archives} or return -1;
+
+# Create some .o files to work with
+utouch(-60, qw(a1.o a2.o a3.o));
+
+# Very simple
+run_make_test('all: libxx.a(a1.o)',
+ '', "ar rv libxx.a a1.o\nar: creating libxx.a\na - a1.o\n");
+
+# Multiple .o's. Add a new one to the existing library
+run_make_test('all: libxx.a(a1.o a2.o)',
+ '', "ar rv libxx.a a2.o\na - a2.o\n");
+
+# Touch one of the .o's so it's rebuilt
+utouch(-40, 'a1.o');
+run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
+
+# Use wildcards
+run_make_test('all: libxx.a(*.o)',
+ '', "#MAKE#: Nothing to be done for `all'.\n");
+
+# Touch one of the .o's so it's rebuilt
+utouch(-30, 'a1.o');
+run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
+
+# Use both wildcards and simple names
+utouch(-50, 'a2.o');
+run_make_test('all: libxx.a(a3.o *.o)', '',
+ "ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n");
+
+rmfiles(qw(a1.o a2.o a3.o libxx.a));
+
+# This tells the test driver that the perl test script executed properly.
+1;