[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-64-g
From: |
Ralf Wildenhues |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-64-g2111d1d |
Date: |
Sun, 18 Oct 2009 15:46:21 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=2111d1d663e6a0cc70ae7fa1f95f638fb7bf0c3e
The branch, master has been updated
via 2111d1d663e6a0cc70ae7fa1f95f638fb7bf0c3e (commit)
via 10091b94bbed06fddb637313f8948b0ee59032f4 (commit)
via 4ccd9cd4ee2792df53e82570370c96769219e8a6 (commit)
via 8fef9e8391f113bd733d4b3c3be7140d3d14ae91 (commit)
via 75a4471072041fdcff422076b8032c3b1dd77a10 (commit)
via 39880d9d00baa3c8c2352aca688256816e84226c (commit)
via 2517914f0a62b8fd21d827bb1401157eb02e2d00 (commit)
from d3f3013d853f36cd6fbc8f61ebecf91e5bb400ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2111d1d663e6a0cc70ae7fa1f95f638fb7bf0c3e
Merge: d3f3013d853f36cd6fbc8f61ebecf91e5bb400ed
10091b94bbed06fddb637313f8948b0ee59032f4
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 17:38:55 2009 +0200
Merge branch 'perl-coverage'
* perl-coverage:
Simplify Variable::_check_ambiguous_condition.
Coverage for DisjConditions.pm.
Coverage and fixes for Condition.pm.
Coverage for Wrap.pm.
Coverage for Version.pm.
Pod coverage for Perl modules.
commit 10091b94bbed06fddb637313f8948b0ee59032f4
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 12:05:43 2009 +0200
Simplify Variable::_check_ambiguous_condition.
* lib/Automake/Variable.pm (_check_ambiguous_condition): No need
to check for $def since ambiguous_p returns an empty $message if
there is no other condition which is ambiguous to $cond.
Signed-off-by: Ralf Wildenhues <address@hidden>
commit 4ccd9cd4ee2792df53e82570370c96769219e8a6
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 12:03:29 2009 +0200
Coverage for DisjConditions.pm.
* lib/Automake/tests/DisjConditions.pl (test_basics): Increase
test coverage: test ->human, ->merge, ->simplify, ->multiply.
* lib/Automake/tests/DisjConditions-t.pl (test_basics): Likewise
changes, but including state copies across thread creation.
* lib/Automake/tests/DisjCon2.pl: New test.
* lib/Automake/tests/DisjCon3.pl: Likewise.
* lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Adjust.
Signed-off-by: Ralf Wildenhues <address@hidden>
commit 8fef9e8391f113bd733d4b3c3be7140d3d14ae91
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 12:01:46 2009 +0200
Coverage and fixes for Condition.pm.
* lib/Automake/Condition.pm (new): Catch common programming
errors better by checking type of passed argument before
munging them to all be strings through split.
* lib/Automake/tests/Condition.pl (test_basics): Also test
->human.
(test_merge): New function, test ->merge, ->merge_conds,
->strip.
* lib/Automake/tests/Condition-t.pl (test_basics, test_merge):
Likewise changes, but including state copies across thread
creation.
* lib/Automake/tests/Cond2.pl: New test for programming error.
* lib/Automake/tests/Cond3.pl: Likewise.
* lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
Signed-off-by: Ralf Wildenhues <address@hidden>
commit 75a4471072041fdcff422076b8032c3b1dd77a10
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 11:55:10 2009 +0200
Coverage for Wrap.pm.
* lib/Automake/tests/Wrap.pl (@tests): Add test for word with
trailing space.
(test_makefile_wrap, @makefile_tests): New function, new list of
tests, to test makefile_wrap.
Signed-off-by: Ralf Wildenhues <address@hidden>
commit 39880d9d00baa3c8c2352aca688256816e84226c
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 11:46:14 2009 +0200
Coverage for Version.pm.
* lib/Automake/tests/Version.pl (test_version_compare): Also
try Automake::Version::check for the version pairs, taking into
account the special-case naming of code forks.
(@tests): Add more test cases.
(test_bad_versions, @bad_versions): New function, new test cases,
to ensure bad version strings are rejected.
* lib/Automake/tests/Version2.pl: New test.
* lib/Automake/tests/Version3.pl: Likewise.
* lib/Automake/tests/Makefile.am (TESTS): Add tests here ...
(XFAIL_TESTS): ... and here, new.
Signed-off-by: Ralf Wildenhues <address@hidden>
commit 2517914f0a62b8fd21d827bb1401157eb02e2d00
Author: Ralf Wildenhues <address@hidden>
Date: Sun Oct 18 10:00:28 2009 +0200
Pod coverage for Perl modules.
* lib/Automake/ChannelDefs.pm (parse_warnings): Fix
typo in Pod documentation.
* lib/Automake/Condition.pm: Add a couple of missing `=back'
lines.
(_has): Renamed from ...
(has): ... this, as this is an internal method.
(strip, false, true_when): Adjust callers.
* lib/Automake/Configure_ac.pm: Add Pod `Functions' section with
documentation for find_configure_ac and require_configure_ac.
* lib/Automake/Location.pm: Fix typo in Pod. Add `Methods'
section, document methods.
* lib/Automake/RuleDef.pm: New `Methods' Pod section.
* lib/Automake/VarDef.pm: Document `raw_value'.
* lib/Automake/Wrap.pm (_tab_length): Rename from ...
(tab_length): ... this, as this is an internal method.
(wrap): Adjust callers.
* lib/Automake/XFile.pm: Reorganize Pod a bit, add `Methods'
section.
Signed-off-by: Ralf Wildenhues <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 69 ++++++++++++++++++++
lib/Automake/ChannelDefs.pm | 7 +-
lib/Automake/Condition.pm | 27 +++++---
lib/Automake/Configure_ac.pm | 22 ++++++-
lib/Automake/Location.pm | 72 ++++++++++++++++++++-
lib/Automake/RuleDef.pm | 29 ++++++++-
lib/Automake/VarDef.pm | 4 +-
lib/Automake/Variable.pm | 2 +-
lib/Automake/Wrap.pm | 16 +++---
lib/Automake/XFile.pm | 109 ++++++++++++++++++++-----------
lib/Automake/tests/Cond2.pl | 6 ++
lib/Automake/tests/Cond3.pl | 6 ++
lib/Automake/tests/Condition-t.pl | 45 +++++++++++---
lib/Automake/tests/Condition.pl | 39 +++++++++---
lib/Automake/tests/DisjCon2.pl | 8 +++
lib/Automake/tests/DisjCon3.pl | 7 ++
lib/Automake/tests/DisjConditions-t.pl | 26 ++++++++
lib/Automake/tests/DisjConditions.pl | 26 +++++++-
lib/Automake/tests/Makefile.am | 14 ++++
lib/Automake/tests/Makefile.in | 14 ++++
lib/Automake/tests/Version.pl | 36 ++++++++++-
lib/Automake/tests/Version2.pl | 5 ++
lib/Automake/tests/Version3.pl | 5 ++
lib/Automake/tests/Wrap.pl | 38 +++++++++++-
24 files changed, 542 insertions(+), 90 deletions(-)
create mode 100644 lib/Automake/tests/Cond2.pl
create mode 100644 lib/Automake/tests/Cond3.pl
create mode 100644 lib/Automake/tests/DisjCon2.pl
create mode 100644 lib/Automake/tests/DisjCon3.pl
create mode 100644 lib/Automake/tests/Version2.pl
create mode 100644 lib/Automake/tests/Version3.pl
diff --git a/ChangeLog b/ChangeLog
index 0dd9199..2fe0566 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,72 @@
+2009-10-18 Ralf Wildenhues <address@hidden>
+
+ Simplify Variable::_check_ambiguous_condition.
+ * lib/Automake/Variable.pm (_check_ambiguous_condition): No need
+ to check for $def since ambiguous_p returns an empty $message if
+ there is no other condition which is ambiguous to $cond.
+
+ Coverage for DisjConditions.pm.
+ * lib/Automake/tests/DisjConditions.pl (test_basics): Increase
+ test coverage: test ->human, ->merge, ->simplify, ->multiply.
+ * lib/Automake/tests/DisjConditions-t.pl (test_basics): Likewise
+ changes, but including state copies across thread creation.
+ * lib/Automake/tests/DisjCon2.pl: New test.
+ * lib/Automake/tests/DisjCon3.pl: Likewise.
+ * lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Adjust.
+
+ Coverage and fixes for Condition.pm.
+ * lib/Automake/Condition.pm (new): Catch common programming
+ errors better by checking type of passed argument before
+ munging them to all be strings through split.
+ * lib/Automake/tests/Condition.pl (test_basics): Also test
+ ->human.
+ (test_merge): New function, test ->merge, ->merge_conds,
+ ->strip.
+ * lib/Automake/tests/Condition-t.pl (test_basics, test_merge):
+ Likewise changes, but including state copies across thread
+ creation.
+ * lib/Automake/tests/Cond2.pl: New test for programming error.
+ * lib/Automake/tests/Cond3.pl: Likewise.
+ * lib/Automake/tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
+
+ Coverage for Wrap.pm.
+ * lib/Automake/tests/Wrap.pl (@tests): Add test for word with
+ trailing space.
+ (test_makefile_wrap, @makefile_tests): New function, new list of
+ tests, to test makefile_wrap.
+
+ Coverage for Version.pm.
+ * lib/Automake/tests/Version.pl (test_version_compare): Also
+ try Automake::Version::check for the version pairs, taking into
+ account the special-case naming of code forks.
+ (@tests): Add more test cases.
+ (test_bad_versions, @bad_versions): New function, new test cases,
+ to ensure bad version strings are rejected.
+ * lib/Automake/tests/Version2.pl: New test.
+ * lib/Automake/tests/Version3.pl: Likewise.
+ * lib/Automake/tests/Makefile.am (TESTS): Add tests here ...
+ (XFAIL_TESTS): ... and here, new.
+
+ Pod coverage for Perl modules.
+ * lib/Automake/ChannelDefs.pm (parse_warnings): Fix
+ typo in Pod documentation.
+ * lib/Automake/Condition.pm: Add a couple of missing `=back'
+ lines.
+ (_has): Renamed from ...
+ (has): ... this, as this is an internal method.
+ (strip, false, true_when): Adjust callers.
+ * lib/Automake/Configure_ac.pm: Add Pod `Functions' section with
+ documentation for find_configure_ac and require_configure_ac.
+ * lib/Automake/Location.pm: Fix typo in Pod. Add `Methods'
+ section, document methods.
+ * lib/Automake/RuleDef.pm: New `Methods' Pod section.
+ * lib/Automake/VarDef.pm: Document `raw_value'.
+ * lib/Automake/Wrap.pm (_tab_length): Rename from ...
+ (tab_length): ... this, as this is an internal method.
+ (wrap): Adjust callers.
+ * lib/Automake/XFile.pm: Reorganize Pod a bit, add `Methods'
+ section.
+
2009-10-17 Ralf Wildenhues <address@hidden>
Perl coverage support using Devel::Cover.
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index a740603..ce6bf29 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -1,4 +1,5 @@
-# Copyright (C) 2002, 2003, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006, 2008, 2009 Free Software Foundation,
+# Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,7 +44,7 @@ Automake::ChannelDefs - channel definitions for Automake and
helper functions
verb ($MESSAGE, [%OPTIONS]);
switch_warning ($CATEGORY);
parse_WARNINGS ();
- parse_warning ($OPTION, $ARGUMENT);
+ parse_warnings ($OPTION, $ARGUMENT);
Automake::ChannelDefs::set_strictness ($STRICTNESS_NAME);
=head1 DESCRIPTION
@@ -307,7 +308,7 @@ sub parse_WARNINGS ()
}
}
-=item C<parse_warning ($OPTION, $ARGUMENT)>
+=item C<parse_warnings ($OPTION, $ARGUMENT)>
Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.
diff --git a/lib/Automake/Condition.pm b/lib/Automake/Condition.pm
index 2d649f6..5c54b8b 100644
--- a/lib/Automake/Condition.pm
+++ b/lib/Automake/Condition.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 2001, 2002, 2003, 2006, 2008 Free Software
+# Copyright (C) 1997, 2001, 2002, 2003, 2006, 2008, 2009 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -180,18 +180,21 @@ sub new ($;@)
};
bless $self, $class;
- # Accept strings like "FOO BAR" as shorthand for ("FOO", "BAR").
- @conds = map { split (' ', $_) } @conds;
-
for my $cond (@conds)
{
- next if $cond eq 'TRUE';
-
# Catch some common programming errors:
# - A Condition passed to new
confess "`$cond' is a reference, expected a string" if ref $cond;
# - A Condition passed as a string to new
confess "`$cond' does not look like a condition" if $cond =~ /::/;
+ }
+
+ # Accept strings like "FOO BAR" as shorthand for ("FOO", "BAR").
+ @conds = map { split (' ', $_) } @conds;
+
+ for my $cond (@conds)
+ {
+ next if $cond eq 'TRUE';
# Detect cases when @conds can be simplified to FALSE.
if (($cond eq 'FALSE' && $#conds > 0)
@@ -250,7 +253,7 @@ except those of C<$minuscond>. This is the opposite of
C<merge>.
sub strip ($$)
{
my ($self, $minus) = @_;
- my @res = grep { not $minus->has ($_) } $self->conds;
+ my @res = grep { not $minus->_has ($_) } $self->conds;
return new Automake::Condition @res;
}
@@ -274,7 +277,7 @@ sub conds ($ )
}
# Undocumented, shouldn't be needed outside of this class.
-sub has ($$)
+sub _has ($$)
{
my ($self, $cond) = @_;
return exists $self->{'hash'}{$cond};
@@ -289,7 +292,7 @@ Return 1 iff this condition is always false.
sub false ($ )
{
my ($self) = @_;
- return $self->has ('FALSE');
+ return $self->_has ('FALSE');
}
=item C<$cond-E<gt>true>
@@ -426,7 +429,7 @@ sub true_when ($$)
# exists in $WHEN.
foreach my $cond ($self->conds)
{
- return 0 unless $when->has ($cond);
+ return 0 unless $when->_has ($cond);
}
return 1;
}
@@ -518,6 +521,8 @@ sub multiply ($@)
return (values %res);
}
+=back
+
=head2 Other helper functions
=over 4
@@ -615,6 +620,8 @@ sub conditional_negate ($)
return $cond;
}
+=back
+
=head1 SEE ALSO
L<Automake::DisjConditions>.
diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm
index 646fad3..d5ad977 100644
--- a/lib/Automake/Configure_ac.pm
+++ b/lib/Automake/Configure_ac.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -49,6 +49,20 @@ Automake::Configure_ac - Locate configure.ac or configure.in.
my $file_name = find_configure_ac ($dir);
my $file_name = require_configure_ac ($dir);
+=over 4
+
+=back
+
+=head2 Functions
+
+=over 4
+
+=item C<$configure_ac = find_configure_ac ([$directory])>
+
+Find a F<configure.ac> or F<configure.in> file in C<$directory>,
+defaulting to the current directory. Complain if both files are present.
+Return the name of the file found, or the former if neither is present.
+
=cut
sub find_configure_ac (;@)
@@ -78,6 +92,12 @@ sub find_configure_ac (;@)
}
+=item C<$configure_ac = require_configure_ac ([$directory])>
+
+Like C<find_configure_ac>, but fail if neither is present.
+
+=cut
+
sub require_configure_ac (;$)
{
my $res = find_configure_ac (@_);
diff --git a/lib/Automake/Location.pm b/lib/Automake/Location.pm
index 613dc80..1dc81dc 100644
--- a/lib/Automake/Location.pm
+++ b/lib/Automake/Location.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2008, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ Automake::Location - a class for location tracking, with a
stack of contexts
...
}
- # Pop a context, and reset the location from the previous context.
+ # Pop a context, and reset the location to the previous context.
$where->pop_context;
# Clone a Location. Use this when storing the state of a location
@@ -84,6 +84,16 @@ You can pass a C<Location> to C<Automake::Channels::msg>.
=cut
+=head2 Methods
+
+=over
+
+=item C<$where = new Automake::Location ([$position])>
+
+Create and return a new Location object.
+
+=cut
+
sub new ($;$)
{
my ($class, $position) = @_;
@@ -95,18 +105,36 @@ sub new ($;$)
return $self;
}
+=item C<$location-E<gt>set ($position)>
+
+Change the location to be C<$position>.
+
+=cut
+
sub set ($$)
{
my ($self, $position) = @_;
$self->{'position'} = $position;
}
+=item C<$location-E<gt>get>
+
+Get the location (without context).
+
+=cut
+
sub get ($)
{
my ($self) = @_;
return $self->{'position'};
}
+=item C<$location-E<gt>push_context ($context)>
+
+Push a context to the location.
+
+=cut
+
sub push_context ($$)
{
my ($self, $context) = @_;
@@ -114,6 +142,12 @@ sub push_context ($$)
$self->set (undef);
}
+=item C<$where = $location-E<gt>pop_context ($context)>
+
+Pop a context, and reset the location to the previous context.
+
+=cut
+
sub pop_context ($)
{
my ($self) = @_;
@@ -122,12 +156,25 @@ sub pop_context ($)
return @{$pair};
}
+=item C<@contexts = $location-E<gt>get_contexts>
+
+Return the array of contexts.
+
+=cut
+
sub get_contexts ($)
{
my ($self) = @_;
return @{$self->{'contexts'}};
}
+=item C<$location = $location-E<gt>clone>
+
+Clone a Location. Use this when storing the state of a location
+that would otherwise be modified.
+
+=cut
+
sub clone ($)
{
my ($self) = @_;
@@ -140,6 +187,12 @@ sub clone ($)
return $other;
}
+=item C<$res = $location-E<gt>dump>
+
+Print the location and the stack of context (for debugging).
+
+=cut
+
sub dump ($)
{
my ($self) = @_;
@@ -152,6 +205,13 @@ sub dump ($)
return $res;
}
+=item C<@array = $location-E<gt>serialize>
+
+Serialize a Location object (for passing through a thread queue,
+for example).
+
+=cut
+
sub serialize ($)
{
my ($self) = @_;
@@ -166,6 +226,12 @@ sub serialize ($)
return @serial;
}
+=item C<new Automake::Location::deserialize ($queue)>
+
+De-serialize: recreate a Location object from a queue.
+
+=cut
+
sub deserialize ($)
{
my ($queue) = @_;
@@ -179,6 +245,8 @@ sub deserialize ($)
return $self;
}
+=back
+
=head1 SEE ALSO
L<Automake::Channels>
diff --git a/lib/Automake/RuleDef.pm b/lib/Automake/RuleDef.pm
index 20bc106..3bd506d 100644
--- a/lib/Automake/RuleDef.pm
+++ b/lib/Automake/RuleDef.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,6 +36,7 @@ Automake::RuleDef - a class for rule definitions
=head1 DESCRIPTION
This class gathers data related to one Makefile-rule definition.
+It shouldn't be needed outside of F<Rule.pm>.
=head2 Constants
@@ -50,6 +51,20 @@ Possible owners for rules.
use constant RULE_AUTOMAKE => 0; # Rule defined by Automake.
use constant RULE_USER => 1; # Rule defined in the user's Makefile.am.
+=back
+
+=head2 Methods
+
+=over 4
+
+=item C<new Automake::RuleDef ($name, $comment, $location, $owner, $source)>
+
+Create a new rule definition with target C<$name>, with associated comment
+C<$comment>, Location C<$location> and owner C<$owner>, defined in file
+C<$source>.
+
+=cut
+
sub new ($$$$$)
{
my ($class, $name, $comment, $location, $owner, $source) = @_;
@@ -60,12 +75,24 @@ sub new ($$$$$)
return $self;
}
+=item C<$source = $rule-E<gt>source>
+
+Return the source of the rule.
+
+=cut
+
sub source ($)
{
my ($self) = @_;
return $self->{'source'};
}
+=item C<$name = $rule-E<gt>name>
+
+Return the name of the rule.
+
+=cut
+
sub name ($)
{
my ($self) = @_;
diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm
index d7ba155..7d10bb6 100644
--- a/lib/Automake/VarDef.pm
+++ b/lib/Automake/VarDef.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -204,6 +204,8 @@ sub append ($$$)
=item C<$def-E<gt>value>
+=item C<$def-E<gt>raw_value>
+
=item C<$def-E<gt>type>
=item C<$def-E<gt>pretty>
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f0c867f..30dcc79 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -469,7 +469,7 @@ sub _check_ambiguous_condition ($$$)
# We allow silent variables to be overridden silently,
# by either silent or non-silent variables.
my $def = $self->def ($ambig_cond);
- if ($message && !($def && $def->pretty == VAR_SILENT))
+ if ($message && $def->pretty != VAR_SILENT)
{
msg 'syntax', $where, "$message ...", partial => 1;
msg_var ('syntax', $var, "... `$var' previously defined here");
diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm
index 09a135a..ad1d81e 100644
--- a/lib/Automake/Wrap.pm
+++ b/lib/Automake/Wrap.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,10 +48,10 @@ maximum length allowed. (Ticket #17141, fixed in Perl
5.8.0.)
=cut
-# tab_length ($TXT)
-# -----------------
+# _tab_length ($TXT)
+# ------------------
# Compute the length of TXT, counting tab characters as 8 characters.
-sub tab_length($)
+sub _tab_length($)
{
my ($txt) = @_;
my $len = length ($txt);
@@ -78,16 +78,16 @@ sub wrap($$$$@)
my ($head, $fill, $eol, $max_len, @values) = @_;
my $result = $head;
- my $column = tab_length ($head);
+ my $column = _tab_length ($head);
- my $fill_len = tab_length ($fill);
- my $eol_len = tab_length ($eol);
+ my $fill_len = _tab_length ($fill);
+ my $eol_len = _tab_length ($eol);
my $not_first_word = 0;
foreach (@values)
{
- my $len = tab_length ($_);
+ my $len = _tab_length ($_);
# See if the new variable fits on this line.
# (The + 1 is for the space we add in front of the value.).
diff --git a/lib/Automake/XFile.pm b/lib/Automake/XFile.pm
index f99a00a..b67e251 100644
--- a/lib/Automake/XFile.pm
+++ b/lib/Automake/XFile.pm
@@ -68,18 +68,6 @@ methods C<close>, C<lock> (corresponding to C<flock>),
C<new>,
C<open>, C<seek>, and C<truncate>. It also overrides the C<getline>
and C<getlines> methods to translate C<\r\n> to C<\n>.
-=head1 SEE ALSO
-
-L<perlfunc>,
-L<perlop/"I/O Operators">,
-L<IO::File>
-L<IO::Handle>
-L<IO::Seekable>
-
-=head1 HISTORY
-
-Derived from IO::File.pm by Akim Demaille E<lt>F<address@hidden>E<gt>.
-
=cut
require 5.000;
@@ -113,9 +101,16 @@ eval {
# Used in croak error messages.
my $me = basename ($0);
-################################################
-## Constructor
-##
+=head2 Methods
+
+=over
+
+=item C<$fh = new Automake::XFile ([$expr, ...]>
+
+Constructor a new XFile object. Additional arguments
+are passed to C<open>, if any.
+
+=cut
sub new
{
@@ -129,9 +124,12 @@ sub new
$fh;
}
-################################################
-## Open
-##
+=item C<$fh-E<gt>open ([$file, ...])>
+
+Open a file, passing C<$file> and further arguments to C<IO::File::open>.
+Die if opening fails. Store the name of the file. Use binmode for writing.
+
+=cut
sub open
{
@@ -156,9 +154,11 @@ sub open
binmode $fh if $file =~ /^\s*>/;
}
-################################################
-## Close
-##
+=item C<$fh-E<gt>close>
+
+Close the file, handling errors.
+
+=cut
sub close
{
@@ -172,9 +172,12 @@ sub close
}
}
-################################################
-## Getline
-##
+=item C<$line = $fh-E<gt>getline>
+
+Read and return a line from the file. Ensure C<\r\n> is translated to
+C<\n> on input files.
+
+=cut
# Some Win32/perl installations fail to translate \r\n to \n on input
# so we do that here.
@@ -187,9 +190,11 @@ sub getline
return $_;
}
-################################################
-## Getlines
-##
+=item C<@lines = $fh-E<gt>getlines>
+
+Slurp lines from the files.
+
+=cut
sub getlines
{
@@ -199,9 +204,11 @@ sub getlines
return @res;
}
-################################################
-## Name
-##
+=item C<$name = $fh-E<gt>name>
+
+Return the name of the file.
+
+=cut
sub name
{
@@ -209,9 +216,13 @@ sub name
return ${*$fh}{'autom4te_xfile_file'};
}
-################################################
-## Lock
-##
+=item C<$fh-E<gt>lock>
+
+Lock the file using C<flock>. If locking fails for reasons other than
+C<flock> being unsupported, then error out if C<$ENV{'MAKEFLAGS'}> indicates
+that we are spawned from a parallel C<make>.
+
+=cut
sub lock
{
@@ -243,9 +254,11 @@ sub lock
}
}
-################################################
-## Seek
-##
+=item C<$fh-E<gt>seek ($position, [$whence])>
+
+Seek file to C<$position>. Die if seeking fails.
+
+=cut
sub seek
{
@@ -258,9 +271,11 @@ sub seek
}
}
-################################################
-## Truncate
-##
+=item C<$fh-E<gt>truncate ($len)>
+
+Truncate the file to length C<$len>. Die on failure.
+
+=cut
sub truncate
{
@@ -272,6 +287,22 @@ sub truncate
}
}
+=back
+
+=head1 SEE ALSO
+
+L<perlfunc>,
+L<perlop/"I/O Operators">,
+L<IO::File>
+L<IO::Handle>
+L<IO::Seekable>
+
+=head1 HISTORY
+
+Derived from IO::File.pm by Akim Demaille E<lt>F<address@hidden>E<gt>.
+
+=cut
+
1;
### Setup "GNU" style for perl-mode and cperl-mode.
diff --git a/lib/Automake/tests/Cond2.pl b/lib/Automake/tests/Cond2.pl
new file mode 100644
index 0000000..4ad0e1c
--- /dev/null
+++ b/lib/Automake/tests/Cond2.pl
@@ -0,0 +1,6 @@
+# Catch common programming error:
+# A Condition passed as a string to 'new'.
+use Automake::Condition;
+
+my $cond = new Automake::Condition ('TRUE');
+new Automake::Condition ($cond);
diff --git a/lib/Automake/tests/Cond3.pl b/lib/Automake/tests/Cond3.pl
new file mode 100644
index 0000000..dc957af
--- /dev/null
+++ b/lib/Automake/tests/Cond3.pl
@@ -0,0 +1,6 @@
+# Catch common programming error:
+# A Condition passed as a string to 'new'.
+use Automake::Condition;
+
+my $cond = new Automake::Condition ("COND1_TRUE");
+new Automake::Condition ("$cond");
diff --git a/lib/Automake/tests/Condition-t.pl
b/lib/Automake/tests/Condition-t.pl
index 0f1dde8..99004ac 100644
--- a/lib/Automake/tests/Condition-t.pl
+++ b/lib/Automake/tests/Condition-t.pl
@@ -34,15 +34,15 @@ use Automake::Condition qw/TRUE FALSE/;
sub test_basics ()
{
- my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string]
- [[], 1, 0, 'TRUE', ''],
- [['TRUE'], 1, 0, 'TRUE', ''],
- [['FALSE'], 0, 1, 'FALSE', '#'],
- [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@'],
+ my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string,
human]
+ [[], 1, 0, 'TRUE', '', 'TRUE'],
+ [['TRUE'], 1, 0, 'TRUE', '', 'TRUE'],
+ [['FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+ [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@', 'A'],
[['A_TRUE', 'B_FALSE'],
- 0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@'],
- [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#'],
- [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#']);
+ 0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@', 'A and !B'],
+ [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+ [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#', 'FALSE']);
for (@tests)
{
@@ -55,6 +55,7 @@ sub test_basics ()
return 1 if $_->[2] != ($a == FALSE);
return 1 if $_->[3] ne $a->string;
return 1 if $_->[4] ne $a->subst_string;
+ return 1 if $_->[5] ne $a->human;
})->join;
}
return 0;
@@ -283,7 +284,33 @@ sub test_reduce_or ()
return $failed;
}
-exit (test_basics || test_true_when || test_reduce_and || test_reduce_or);
+sub test_merge ()
+{
+ my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
+ return threads->new(sub {
+ my $other = new Automake::Condition "COND3_FALSE";
+ return threads->new(sub {
+ my $both = $cond->merge ($other);
+ return threads->new(sub {
+ my $both2 = $cond->merge_conds ("COND3_FALSE");
+ return threads->new(sub {
+ $cond = $both->strip ($other);
+ my @conds = $cond->conds;
+ return 1 if $both->string ne "COND1_TRUE COND2_FALSE COND3_FALSE";
+ return 1 if $cond->string ne "COND1_TRUE COND2_FALSE";
+ return 1 if $both != $both2;
+ })->join;
+ })->join;
+ })->join;
+ })->join;
+ return 0;
+}
+
+exit (test_basics
+ || test_true_when
+ || test_reduce_and
+ || test_reduce_or
+ || test_merge);
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
diff --git a/lib/Automake/tests/Condition.pl b/lib/Automake/tests/Condition.pl
index 86f1745..e330e53 100644
--- a/lib/Automake/tests/Condition.pl
+++ b/lib/Automake/tests/Condition.pl
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -19,15 +19,15 @@ use Automake::Condition qw/TRUE FALSE/;
sub test_basics ()
{
- my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string]
- [[], 1, 0, 'TRUE', ''],
- [['TRUE'], 1, 0, 'TRUE', ''],
- [['FALSE'], 0, 1, 'FALSE', '#'],
- [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@'],
+ my @tests = (# [[Conditions], is_true?, is_false?, string, subst-string,
human]
+ [[], 1, 0, 'TRUE', '', 'TRUE'],
+ [['TRUE'], 1, 0, 'TRUE', '', 'TRUE'],
+ [['FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+ [['A_TRUE'], 0, 0, 'A_TRUE', '@A_TRUE@', 'A'],
[['A_TRUE', 'B_FALSE'],
- 0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@'],
- [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#'],
- [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#']);
+ 0, 0, 'A_TRUE B_FALSE', '@A_TRUE@@B_FALSE@', 'A and !B'],
+ [['B_TRUE', 'FALSE'], 0, 1, 'FALSE', '#', 'FALSE'],
+ [['B_TRUE', 'B_FALSE'], 0, 1, 'FALSE', '#', 'FALSE']);
for (@tests)
{
@@ -38,6 +38,7 @@ sub test_basics ()
return 1 if $_->[2] != ($a == FALSE);
return 1 if $_->[3] ne $a->string;
return 1 if $_->[4] ne $a->subst_string;
+ return 1 if $_->[5] ne $a->human;
}
return 0;
}
@@ -240,7 +241,25 @@ sub test_reduce_or ()
return $failed;
}
-exit (test_basics || test_true_when || test_reduce_and || test_reduce_or);
+sub test_merge ()
+{
+ my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
+ my $other = new Automake::Condition "COND3_FALSE";
+ my $both = $cond->merge ($other);
+ my $both2 = $cond->merge_conds ("COND3_FALSE");
+ $cond = $both->strip ($other);
+ my @conds = $cond->conds;
+ return 1 if $both->string ne "COND1_TRUE COND2_FALSE COND3_FALSE";
+ return 1 if $cond->string ne "COND1_TRUE COND2_FALSE";
+ return 1 if $both != $both2;
+ return 0;
+}
+
+exit (test_basics
+ || test_true_when
+ || test_reduce_and
+ || test_reduce_or
+ || test_merge);
### Setup "GNU" style for perl-mode and cperl-mode.
## Local Variables:
diff --git a/lib/Automake/tests/DisjCon2.pl b/lib/Automake/tests/DisjCon2.pl
new file mode 100644
index 0000000..9edd8d5
--- /dev/null
+++ b/lib/Automake/tests/DisjCon2.pl
@@ -0,0 +1,8 @@
+# Catch common programming error:
+# A non-Condition reference passed to new.
+use Automake::Condition;
+use Automake::DisjConditions;
+
+my $cond = new Automake::Condition ('TRUE');
+my $cond2 = new Automake::DisjConditions ($cond);
+new Automake::DisjConditions ($cond2);
diff --git a/lib/Automake/tests/DisjCon3.pl b/lib/Automake/tests/DisjCon3.pl
new file mode 100644
index 0000000..8e69e2b
--- /dev/null
+++ b/lib/Automake/tests/DisjCon3.pl
@@ -0,0 +1,7 @@
+# Catch common programming error:
+# A non-reference passed to new.
+use Automake::Condition qw/TRUE FALSE/;
+use Automake::DisjConditions;
+
+my $cond = new Automake::Condition ("COND1_TRUE");
+new Automake::DisjConditions ("$cond");
diff --git a/lib/Automake/tests/DisjConditions-t.pl
b/lib/Automake/tests/DisjConditions-t.pl
index eccdcd6..4df5112 100644
--- a/lib/Automake/tests/DisjConditions-t.pl
+++ b/lib/Automake/tests/DisjConditions-t.pl
@@ -35,18 +35,44 @@ use Automake::DisjConditions;
sub test_basics ()
{
+ my $true = new Automake::DisjConditions TRUE;
+ my $false = new Automake::DisjConditions FALSE;
my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
return threads->new (sub {
my $other = new Automake::Condition "COND3_FALSE";
+ my $another = new Automake::Condition "COND3_TRUE", "COND4_FALSE";
return threads->new (sub {
my $set1 = new Automake::DisjConditions $cond, $other;
return threads->new (sub {
my $set2 = new Automake::DisjConditions $other, $cond;
+ my $set3 = new Automake::DisjConditions FALSE, $another;
return 1 unless $set1 == $set2;
return 1 if $set1->false;
return 1 if $set1->true;
return 1 unless (new Automake::DisjConditions)->false;
return 1 if (new Automake::DisjConditions)->true;
+ return 1 unless $true->human eq 'TRUE';
+ return 1 unless $false->human eq 'FALSE';
+ return 1 unless $set1->human eq "(COND1 and !COND2) or (!COND3)";
+ return 1 unless $set2->human eq "(COND1 and !COND2) or (!COND3)";
+ my $one_cond_human = $set1->one_cond->human;
+ return 1 unless $one_cond_human eq "!COND3"
+ || $one_cond_human eq "COND1 and !COND2";
+ return 1 unless $set1->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+
+ my $merged1 = $set1->merge ($set2);
+ my $merged2 = $set1->merge ($cond);
+ my $mult1 = $set1->multiply ($set3);
+ return threads->new (sub {
+ my $mult2 = $set1->multiply ($another);
+ return threads->new (sub {
+ return 1 unless $merged1->simplify->string eq "COND1_TRUE
COND2_FALSE | COND3_FALSE";
+ return 1 unless $merged2->simplify->string eq "COND1_TRUE
COND2_FALSE | COND3_FALSE";
+ return 1 unless $mult1->string eq "COND1_TRUE COND2_FALSE
COND3_TRUE COND4_FALSE";
+ return 1 unless $mult1 == $mult2;
+ return 0;
+ })->join;
+ })->join;
})->join;
})->join;
})->join;
diff --git a/lib/Automake/tests/DisjConditions.pl
b/lib/Automake/tests/DisjConditions.pl
index 47dea83..7ccac13 100644
--- a/lib/Automake/tests/DisjConditions.pl
+++ b/lib/Automake/tests/DisjConditions.pl
@@ -1,4 +1,5 @@
-# Copyright (C) 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2008, 2009 Free Software Foundation,
+# Inc.
#
# This file is part of GNU Automake.
#
@@ -20,15 +21,38 @@ use Automake::DisjConditions;
sub test_basics ()
{
+ my $true = new Automake::DisjConditions TRUE;
+ my $false = new Automake::DisjConditions FALSE;
my $cond = new Automake::Condition "COND1_TRUE", "COND2_FALSE";
my $other = new Automake::Condition "COND3_FALSE";
+ my $another = new Automake::Condition "COND3_TRUE", "COND4_FALSE";
my $set1 = new Automake::DisjConditions $cond, $other;
my $set2 = new Automake::DisjConditions $other, $cond;
+ my $set3 = new Automake::DisjConditions FALSE, $another;
return 1 unless $set1 == $set2;
return 1 if $set1->false;
return 1 if $set1->true;
return 1 unless (new Automake::DisjConditions)->false;
return 1 if (new Automake::DisjConditions)->true;
+ return 1 unless $true->human eq 'TRUE';
+ return 1 unless $false->human eq 'FALSE';
+ return 1 unless $set1->human eq "(COND1 and !COND2) or (!COND3)";
+ return 1 unless $set2->human eq "(COND1 and !COND2) or (!COND3)";
+ my $one_cond_human = $set1->one_cond->human;
+ return 1 unless $one_cond_human eq "!COND3"
+ || $one_cond_human eq "COND1 and !COND2";
+ return 1 unless $set1->string eq "COND1_TRUE COND2_FALSE | COND3_FALSE";
+
+ my $merged1 = $set1->merge ($set2);
+ my $merged2 = $set1->merge ($cond);
+ my $mult1 = $set1->multiply ($set3);
+ my $mult2 = $set1->multiply ($another);
+ return 1 unless $merged1->simplify->string eq "COND1_TRUE COND2_FALSE |
COND3_FALSE";
+ return 1 unless $merged2->simplify->string eq "COND1_TRUE COND2_FALSE |
COND3_FALSE";
+ return 1 unless $mult1->string eq "COND1_TRUE COND2_FALSE COND3_TRUE
COND4_FALSE";
+ return 1 unless $mult1 == $mult2;
+
+ return 0;
}
sub build_set (@)
diff --git a/lib/Automake/tests/Makefile.am b/lib/Automake/tests/Makefile.am
index b8fb761..722c75c 100644
--- a/lib/Automake/tests/Makefile.am
+++ b/lib/Automake/tests/Makefile.am
@@ -22,9 +22,23 @@ TEST_EXTENSIONS = .pl
TESTS = \
Condition.pl \
Condition-t.pl \
+Cond2.pl \
+Cond3.pl \
DisjConditions.pl \
DisjConditions-t.pl \
+DisjCon2.pl \
+DisjCon3.pl \
Version.pl \
+Version2.pl \
+Version3.pl \
Wrap.pl
+XFAIL_TESTS = \
+Cond2.pl \
+Cond3.pl \
+DisjCon2.pl \
+DisjCon3.pl \
+Version2.pl \
+Version3.pl
+
EXTRA_DIST = $(TESTS)
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 7ab305f..0bbced3 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -235,11 +235,25 @@ TEST_EXTENSIONS = .pl
TESTS = \
Condition.pl \
Condition-t.pl \
+Cond2.pl \
+Cond3.pl \
DisjConditions.pl \
DisjConditions-t.pl \
+DisjCon2.pl \
+DisjCon3.pl \
Version.pl \
+Version2.pl \
+Version3.pl \
Wrap.pl
+XFAIL_TESTS = \
+Cond2.pl \
+Cond3.pl \
+DisjCon2.pl \
+DisjCon3.pl \
+Version2.pl \
+Version3.pl
+
EXTRA_DIST = $(TESTS)
all: all-am
diff --git a/lib/Automake/tests/Version.pl b/lib/Automake/tests/Version.pl
index e496435..bea91f0 100644
--- a/lib/Automake/tests/Version.pl
+++ b/lib/Automake/tests/Version.pl
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -42,6 +42,29 @@ sub test_version_compare
print "compare (\"$left\", \"$right\") = $res! (not $result?)\n";
$failed = 1;
}
+
+ my $check_expected = ($result == 0 || $result == 1) ? 0 : 1;
+ # Exception for 'foo' fork.
+ $check_expected = 1
+ if ($right =~ /foo/ && !($left =~ /foo/));
+
+ my $check = Automake::Version::check ($left, $right);
+ if ($check != $check_expected)
+ {
+ print "check (\"$left\", \"$right\") = $check! (not $check_expected?)\n";
+ $failed = 1;
+ }
+}
+
+sub test_bad_versions
+{
+ my ($ver) = @_;
+ my @version = Automake::Version::split ($ver);
+ if ($#version != -1)
+ {
+ print "shouldn't grok \"$ver\"\n";
+ $failed = 1;
+ }
}
my @tests = (
@@ -69,15 +92,24 @@ my @tests = (
['1.5a', '1.5.1f', 1],
['1.5', '1.5.1a', -1],
['1.5.1a', '1.5.1f', -1],
+ ['1.5.1f', '1.5.1a', 1],
+ ['1.5.1f', '1.5.1f', 0],
# special exceptions
['1.6-p5a', '1.6.5a', 0],
['1.6', '1.6-p5a', -1],
['1.6-p4b', '1.6-p5a', -1],
['1.6-p4b', '1.6-foo', 1],
- ['1.6-p4b', '1.6a-foo', -1]
+ ['1.6-p4b', '1.6a-foo', -1],
+ ['1.6-p5', '1.6.5', 0],
+ ['1.6a-foo', '1.6a-foo', 0],
+);
+
+my @bad_versions = (
+ '', 'a', '1', '1a', '1.2.3.4', '-1.2'
);
test_version_compare (@{$_}) foreach @tests;
+test_bad_versions ($_) foreach @bad_versions;
exit $failed;
diff --git a/lib/Automake/tests/Version2.pl b/lib/Automake/tests/Version2.pl
new file mode 100644
index 0000000..038466d
--- /dev/null
+++ b/lib/Automake/tests/Version2.pl
@@ -0,0 +1,5 @@
+# prog_error due to invalid $VERSION.
+
+use Automake::Version;
+
+Automake::Version::check ('', '1.2.3');
diff --git a/lib/Automake/tests/Version3.pl b/lib/Automake/tests/Version3.pl
new file mode 100644
index 0000000..ebac23f
--- /dev/null
+++ b/lib/Automake/tests/Version3.pl
@@ -0,0 +1,5 @@
+# prog_error due to invalid $REQUIRED.
+
+use Automake::Version;
+
+Automake::Version::check ('1.2.3', '');
diff --git a/lib/Automake/tests/Wrap.pl b/lib/Automake/tests/Wrap.pl
index 8d840fc..b415401 100644
--- a/lib/Automake/tests/Wrap.pl
+++ b/lib/Automake/tests/Wrap.pl
@@ -1,4 +1,4 @@
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -15,7 +15,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/>.
-use Automake::Wrap 'wrap';
+use Automake::Wrap qw/wrap makefile_wrap/;
my $failed = 0;
@@ -31,6 +31,18 @@ sub test_wrap
}
}
+sub test_makefile_wrap
+{
+ my ($in, $exp_out) = @_;
+
+ my $out = &makefile_wrap (@$in);
+ if ($out ne $exp_out)
+ {
+ print STDERR "For: @$in\nGot:\n$out\nInstead of:\n$exp_out\n---\n";
+ ++$failed;
+ }
+}
+
my @tests = (
[["HEAD:", "NEXT:", "CONT", 13, "v" ,"a", "l", "ue", "s", "values"],
"HEAD:v aCONT
@@ -55,10 +67,32 @@ big continuation:diag3
"big header: END
cont: word1 END
cont: word2
+"],
+ [["big header:", "", " END", 16, "w1", "w2 ", "w3"],
+"big header: END
+w1 w2 w3
"]);
+my @makefile_tests = (
+ [["target:"],
+"target:
+"],
+ [["target:", "\t"],
+"target:
+"],
+ [["target:", "\t", "prereq1", "prereq2"],
+"target: prereq1 prereq2
+"],
+ [["target: ", "\t", "this is a long list of prerequisites ending in space",
+ "so that there is no need for another space before the backslash",
+ "unlike in the second line"],
+"target: this is a long list of prerequisites ending in space \\
+\tso that there is no need for another space before the backslash \\
+\tunlike in the second line
+"]);
test_wrap (@{$_}) foreach @tests;
+test_makefile_wrap (@{$_}) foreach @makefile_tests;
exit $failed;
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-64-g2111d1d,
Ralf Wildenhues <=