[gnumeric] t6162: avoid failures from mps files



commit 2e142bece5054fc84cadd3bec7246864b82ac934
Author: Morten Welinder <terra gnome org>
Date:   Thu Feb 16 19:44:05 2017 -0500

    t6162: avoid failures from mps files
    
    We use current time for creation-time, so once in a blue moon we would
    see a failure because the two runs crossed a second boundary.  Just
    blank out the creation time.

 NEWS                                 |    1 +
 test/ChangeLog                       |    5 +++++
 test/t6162-gnumeric-deterministic.pl |    9 +++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index b181052..9910db4 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Morten:
        * Doc fixes.
        * Fix xlsx import with missing header/footer. [#778292]
        * Minor xlsx import improvements with alias colors.
+       * Test suite improvements.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.33
diff --git a/test/ChangeLog b/test/ChangeLog
index 62b6fde..ec6c11e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-16  Morten Welinder  <terra gnome org>
+
+       * t6162-gnumeric-deterministic.pl: Ignore creation time
+       differences.
+
 2017-01-30  Morten Welinder <terra gnome org>
 
        * Release 1.12.33
diff --git a/test/t6162-gnumeric-deterministic.pl b/test/t6162-gnumeric-deterministic.pl
index bdec896..2cf0477 100755
--- a/test/t6162-gnumeric-deterministic.pl
+++ b/test/t6162-gnumeric-deterministic.pl
@@ -39,12 +39,17 @@ foreach my $src (@sources) {
            die "Fail\n";
        }
 
-       push @data, &GnumericTest::read_file ($tmp);
+       my $d = &GnumericTest::read_file ($tmp);
+
+       # Some formats (notably mps) set this to current time.
+       $d =~ s{<meta:creation-date>[0-9-:TZ]+</meta:creation-date>}{};
+
+       push @data, $d;
        &GnumericTest::removejunk ($tmp);
     }
 
     if ($data[0] ne $data[1]) {
-       print STDERR "Generates output for $src is not deterministic.\n";
+       print STDERR "Generated output for $src is not deterministic.\n";
        $nbad++;
     } else {
        $ngood++;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]