Commit 212ca68f4f7ce36cbca0090a371edc0a762df5e5

Authored by Jay Berkenbilt
1 parent 31dbfc0e

2.0.2

git-svn-id: svn+q:///qpdf/trunk@634 71b93d88-0707-0410-a8cf-f5a4172ac649
ChangeLog
  1 +2008-06-30 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * 2.0.2: release
  4 +
  5 + * updated embedded qtest to version 1.2 (includes previous
  6 + changes)
  7 +
1 2008-06-07 Jay Berkenbilt <ejb@ql.org> 8 2008-06-07 Jay Berkenbilt <ejb@ql.org>
2 9
3 * qpdf/qtest/qpdf/diff-encrypted: change == to = so that the test 10 * qpdf/qtest/qpdf/diff-encrypted: change == to = so that the test
README.maintainer
@@ -13,7 +13,7 @@ Release Reminders @@ -13,7 +13,7 @@ Release Reminders
13 qpdf/qpdf.cc 13 qpdf/qpdf.cc
14 manual/qpdf-manual.xml 14 manual/qpdf-manual.xml
15 15
16 - make_dist does this automatically. 16 + make_dist verifies this consistency.
17 17
18 * Each year, update copyright notices. Just search for Copyright. 18 * Each year, update copyright notices. Just search for Copyright.
19 Last updated: 2008. 19 Last updated: 2008.
configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
2 dnl This config.in requires autoconf 2.5 or greater. 2 dnl This config.in requires autoconf 2.5 or greater.
3 3
4 AC_PREREQ(2.60) 4 AC_PREREQ(2.60)
5 -AC_INIT(qpdf,2.0.1) 5 +AC_INIT(qpdf,2.0.2)
6 6
7 dnl No AC_CONFIG_HEADERS. If this changes, update README.maintainer. 7 dnl No AC_CONFIG_HEADERS. If this changes, update README.maintainer.
8 AC_CONFIG_FILES([autoconf.mk]) 8 AC_CONFIG_FILES([autoconf.mk])
manual/qpdf-manual.xml
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 <!ENTITY mdash "&#x2014;"> 5 <!ENTITY mdash "&#x2014;">
6 <!ENTITY ndash "&#x2013;"> 6 <!ENTITY ndash "&#x2013;">
7 <!ENTITY nbsp "&#xA0;"> 7 <!ENTITY nbsp "&#xA0;">
8 -<!ENTITY swversion "2.0.1">  
9 -<!ENTITY lastreleased "May 6, 2008"> 8 +<!ENTITY swversion "2.0.2">
  9 +<!ENTITY lastreleased "June 30, 2008">
10 ]> 10 ]>
11 <book> 11 <book>
12 <bookinfo> 12 <bookinfo>
@@ -1965,6 +1965,21 @@ print &quot;\n&quot;; @@ -1965,6 +1965,21 @@ print &quot;\n&quot;;
1965 <title>Release Notes</title> 1965 <title>Release Notes</title>
1966 <variablelist> 1966 <variablelist>
1967 <varlistentry> 1967 <varlistentry>
  1968 + <term>2.0.2: June 30, 2008</term>
  1969 + <listitem>
  1970 + <itemizedlist>
  1971 + <listitem>
  1972 + <para>
  1973 + Update test suite to work properly with a
  1974 + non-<comamnd>bash</comamnd> <filename>/bin/sh</filename> and
  1975 + with Perl 5.10. No changes were made to the actual qpdf
  1976 + source code itself for this release.
  1977 + </para>
  1978 + </listitem>
  1979 + </itemizedlist>
  1980 + </listitem>
  1981 + </varlistentry>
  1982 + <varlistentry>
1968 <term>2.0.1: May 6, 2008</term> 1983 <term>2.0.1: May 6, 2008</term>
1969 <listitem> 1984 <listitem>
1970 <itemizedlist> 1985 <itemizedlist>
qpdf/qpdf.cc
@@ -447,7 +447,7 @@ int main(int argc, char* argv[]) @@ -447,7 +447,7 @@ int main(int argc, char* argv[])
447 // 1 2 3 4 5 6 7 8 447 // 1 2 3 4 5 6 7 8
448 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 448 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
449 std::cout 449 std::cout
450 - << whoami << " version 2.0.1" << std::endl 450 + << whoami << " version 2.0.2" << std::endl
451 << "Copyright (c) 2005-2008 Jay Berkenbilt" 451 << "Copyright (c) 2005-2008 Jay Berkenbilt"
452 << std::endl 452 << std::endl
453 << "This software may be distributed under the terms of version 2 of the" 453 << "This software may be distributed under the terms of version 2 of the"
qtest/bin/qtest-driver
@@ -33,7 +33,7 @@ require TestDriver; @@ -33,7 +33,7 @@ require TestDriver;
33 33
34 if ((@ARGV == 1) && ($ARGV[0] eq '--version')) 34 if ((@ARGV == 1) && ($ARGV[0] eq '--version'))
35 { 35 {
36 - print "$whoami version 1.1\n"; 36 + print "$whoami version 1.2\n";
37 exit 0; 37 exit 0;
38 } 38 }
39 if ((@ARGV == 1) && ($ARGV[0] eq '--print-path')) 39 if ((@ARGV == 1) && ($ARGV[0] eq '--print-path'))
qtest/module/TestDriver.pm
@@ -139,7 +139,10 @@ sub get_tty_features @@ -139,7 +139,10 @@ sub get_tty_features
139 no strict; 139 no strict;
140 local $^W = 0; 140 local $^W = 0;
141 local *X; 141 local *X;
142 - require 'sys/ioctl.ph'; 142 + {
  143 + local $SIG{'__WARN__'} = sub {};
  144 + require 'sys/ioctl.ph';
  145 + }
143 if ((defined &TIOCGWINSZ) && open(X, "+</dev/tty")) 146 if ((defined &TIOCGWINSZ) && open(X, "+</dev/tty"))
144 { 147 {
145 my $winsize = ""; 148 my $winsize = "";
@@ -671,6 +674,8 @@ sub runtest @@ -671,6 +674,8 @@ sub runtest
671 my $pid = undef; 674 my $pid = undef;
672 my $pid_killer = new TestDriver::PidKiller(\$pid); 675 my $pid_killer = new TestDriver::PidKiller(\$pid);
673 my $in = new IO::Handle; 676 my $in = new IO::Handle;
  677 + my $use_tempfile = ($^O eq 'MSWin32');
  678 + my $tempout_status = undef;
674 if (defined $in_string) 679 if (defined $in_string)
675 { 680 {
676 &QTC::TC("testdriver", "TestDriver input string"); 681 &QTC::TC("testdriver", "TestDriver input string");
@@ -687,11 +692,30 @@ sub runtest @@ -687,11 +692,30 @@ sub runtest
687 } 692 }
688 elsif (defined $in_command) 693 elsif (defined $in_command)
689 { 694 {
690 - $pid = open($in, "-|");  
691 - croak +__PACKAGE__, "->runtest: fork failed: $!\n" unless defined $pid; 695 + my $tempfilename = "$tempdir/tempout";
  696 + my $tempfile = undef;
  697 + if ($use_tempfile)
  698 + {
  699 + $tempfile = new IO::File(">$tempfilename") or
  700 + die +(+__PACKAGE__,
  701 + "->runtest: unable to create $tempfilename: $!\n");
  702 + $pid = fork;
  703 + croak +__PACKAGE__, "->runtest: fork failed: $!\n"
  704 + unless defined $pid;
  705 + }
  706 + else
  707 + {
  708 + $pid = open($in, "-|");
  709 + croak +__PACKAGE__, "->runtest: fork failed: $!\n"
  710 + unless defined $pid;
  711 + }
692 if ($pid == 0) 712 if ($pid == 0)
693 { 713 {
694 # child 714 # child
  715 + if (defined $tempfile)
  716 + {
  717 + open(STDOUT, ">&", $tempfile);
  718 + }
695 open(STDERR, ">&STDOUT"); 719 open(STDERR, ">&STDOUT");
696 open(STDIN, '<', \ ""); 720 open(STDIN, '<', \ "");
697 if (ref($in_command) eq 'ARRAY') 721 if (ref($in_command) eq 'ARRAY')
@@ -711,6 +735,19 @@ sub runtest @@ -711,6 +735,19 @@ sub runtest
711 $in_command, "\n"); 735 $in_command, "\n");
712 } 736 }
713 } 737 }
  738 + else
  739 + {
  740 + if (defined $tempfile)
  741 + {
  742 + waitpid($pid, 0);
  743 + $tempout_status = $?;
  744 + $pid = undef;
  745 + open($in, "<$tempfilename") or
  746 + croak +(+__PACKAGE__,
  747 + "->runtest: unable to read from" .
  748 + " input file $tempfilename: $!\n");
  749 + }
  750 + }
714 } 751 }
715 else 752 else
716 { 753 {
@@ -768,22 +805,25 @@ sub runtest @@ -768,22 +805,25 @@ sub runtest
768 last if defined $exit_status; 805 last if defined $exit_status;
769 } 806 }
770 $in->close(); 807 $in->close();
  808 + if (defined $tempout_status)
  809 + {
  810 + $exit_status = $tempout_status;
  811 + }
771 if (defined $in_command) 812 if (defined $in_command)
772 { 813 {
773 if (! defined $exit_status) 814 if (! defined $exit_status)
774 { 815 {
775 $exit_status = $?; 816 $exit_status = $?;
776 } 817 }
777 - if (($exit_status > 0) && ($exit_status < 256)) 818 + if (WIFSIGNALED($exit_status))
778 { 819 {
779 &QTC::TC("testdriver", "TestDriver exit status signal"); 820 &QTC::TC("testdriver", "TestDriver exit status signal");
780 - $exit_status &= 127; # clear core dump flag  
781 - $exit_status = "SIG:$exit_status"; 821 + $exit_status = "SIG:" . WTERMSIG($exit_status);
782 } 822 }
783 - else 823 + elsif (WIFEXITED($exit_status))
784 { 824 {
785 &QTC::TC("testdriver", "TestDriver exit status number"); 825 &QTC::TC("testdriver", "TestDriver exit status number");
786 - $exit_status >>= 8; 826 + $exit_status = WEXITSTATUS($exit_status);
787 } 827 }
788 } 828 }
789 $? = 0; 829 $? = 0;
@@ -1533,28 +1573,44 @@ sub rmrf @@ -1533,28 +1573,44 @@ sub rmrf
1533 sub safe_pipe 1573 sub safe_pipe
1534 { 1574 {
1535 my ($cmd, $outfile) = @_; 1575 my ($cmd, $outfile) = @_;
1536 - my $pid = open(C, "-|");  
1537 my $result = 0; 1576 my $result = 0;
1538 1577
1539 - if ($pid) 1578 + if ($^O eq 'MSWin32')
1540 { 1579 {
1541 - # parent  
1542 - my $out = new IO::File(">$outfile") or  
1543 - die +__PACKAGE__, ": can't open $outfile: $!\n";  
1544 - binmode C;  
1545 - while (<C>) 1580 + my @cmd = @$cmd;
  1581 + my $cmd_str = shift(@cmd);
  1582 + while (@cmd)
1546 { 1583 {
1547 - $out->print($_); 1584 + my $arg = shift(@cmd);
  1585 + $cmd_str .= " \"$arg\"";
1548 } 1586 }
1549 - close(C);  
1550 - $result = $?;  
1551 - $out->close(); 1587 + $cmd_str .= " > $outfile 2>&1";
  1588 + $result = system($cmd_str);
1552 } 1589 }
1553 else 1590 else
1554 { 1591 {
1555 - # child  
1556 - open(STDERR, ">&STDOUT");  
1557 - exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; 1592 + my $pid = open(C, "-|");
  1593 +
  1594 + if ($pid)
  1595 + {
  1596 + # parent
  1597 + my $out = new IO::File(">$outfile") or
  1598 + die +__PACKAGE__, ": can't open $outfile: $!\n";
  1599 + binmode C;
  1600 + while (<C>)
  1601 + {
  1602 + $out->print($_);
  1603 + }
  1604 + close(C);
  1605 + $result = $?;
  1606 + $out->close();
  1607 + }
  1608 + else
  1609 + {
  1610 + # child
  1611 + open(STDERR, ">&STDOUT");
  1612 + exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n";
  1613 + }
1558 } 1614 }
1559 1615
1560 $result; 1616 $result;