summaryrefslogtreecommitdiff
path: root/tests/scripts/features/archives
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/features/archives')
-rw-r--r--tests/scripts/features/archives26
1 files changed, 21 insertions, 5 deletions
diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives
index 15f433b..a7ec881 100644
--- a/tests/scripts/features/archives
+++ b/tests/scripts/features/archives
@@ -13,6 +13,15 @@ utouch(-60, qw(a1.o a2.o a3.o));
# Some versions of ar print different things on creation. Find out.
my $created = `ar rv libxx.a a1.o 2>&1`;
+
+# Some versions of ar print different things on add. Find out.
+my $add = `ar rv libxx.a a2.o 2>&1`;
+$add =~ s/a2\.o/#OBJECT#/g;
+
+# Some versions of ar print different things on replacement. Find out.
+my $repl = `ar rv libxx.a a2.o 2>&1`;
+$repl =~ s/a2\.o/#OBJECT#/g;
+
unlink('libxx.a');
# Very simple
@@ -20,12 +29,14 @@ run_make_test('all: libxx.a(a1.o)',
'', "ar rv libxx.a a1.o\n$created");
# Multiple .o's. Add a new one to the existing library
+($_ = $add) =~ s/#OBJECT#/a2.o/g;
run_make_test('all: libxx.a(a1.o a2.o)',
- '', "ar rv libxx.a a2.o\na - a2.o\n");
+ '', "ar rv libxx.a 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");
+($_ = $repl) =~ s/#OBJECT#/a1.o/g;
+run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
# Use wildcards
run_make_test('all: libxx.a(*.o)',
@@ -33,17 +44,22 @@ run_make_test('all: libxx.a(*.o)',
# 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");
+($_ = $repl) =~ s/#OBJECT#/a1.o/g;
+run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
# Use both wildcards and simple names
utouch(-50, 'a2.o');
+($_ = $add) =~ s/#OBJECT#/a3.o/g;
+$_ .= "ar rv libxx.a a2.o\n";
+($_ .= $repl) =~ s/#OBJECT#/a2.o/g;
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");
+ "ar rv libxx.a a3.o\n$_");
# Check whitespace handling
utouch(-40, 'a2.o');
+($_ = $repl) =~ s/#OBJECT#/a2.o/g;
run_make_test('all: libxx.a( a3.o *.o )', '',
- "ar rv libxx.a a2.o\nr - a2.o\n");
+ "ar rv libxx.a a2.o\n$_");
rmfiles(qw(a1.o a2.o a3.o libxx.a));