Commit 21a82ff1 authored by Morten Welinder's avatar Morten Welinder

Print the purpose of each test.

parent b0b31430
......@@ -6,7 +6,7 @@ use Config;
@GnumericTest::ISA = qw (Exporter);
@GnumericTest::EXPORT = qw(test_sheet_calc test_importer test_valgrind
test_command
test_command message
$ssconvert $topsrc $samples $PERL);
@GnumericTest::EXPORT_OK = qw(junkfile);
......@@ -97,6 +97,18 @@ sub dump_indented {
# -----------------------------------------------------------------------------
sub message {
my ($message) = @_;
print "-" x 79, "\n";
my $me = $0;
$me =~ s|^.*/||;
foreach (split (/\n/, $message)) {
print "$me: $_\n";
}
}
# -----------------------------------------------------------------------------
sub test_command {
my ($cmd,$test) = @_;
......
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/statfuns.xls", "A4", sub { /All ok/i });
my $file = "statfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/mathfuns.xls", "A4", sub { /All ok/i });
my $file = "mathfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/finfuns.xls", "A4", sub { /All ok/i });
my $file = "finfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/engfuns.xls", "A4", sub { /All ok/i });
my $file = "engfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/textfuns.xls", "A4", sub { /All ok/i });
my $file = "textfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/logfuns.xls", "A4", sub { /All ok/i });
my $file = "logfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/datefuns.xls", "A4", sub { /All ok/i });
my $file = "datefuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/dbfuns.xls", "A4", sub { /All ok/i });
my $file = "dbfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/infofuns.xls", "A4", sub { /All ok/i });
my $file = "infofuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/lookfuns.xls", "A4", sub { /All ok/i });
my $file = "lookfuns.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "A4", sub { /All ok/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/bitwise.xls", "B3:B99", sub { /^(\s*Success)+\s*$/i });
my $file = "bitwise.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "B3:B99", sub { /^(\s*Success)+\s*$/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/excel/operator.xls", "C1:C15", sub { /^(\s*Success)+\s*$/i });
my $file = "operator.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/excel/$file", "C1:C15", sub { /^(\s*Success)+\s*$/i });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/arrays.xls", "B1", sub { /TRUE/ });
my $file = "arrays.xls";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/$file", "B1", sub { /TRUE/ });
......@@ -5,4 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&test_sheet_calc ("$samples/regress.gnumeric", "C2", sub { /No/i });
my $file = "regress.gnumeric";
&message ("Check that $file evaluates correctly.");
&test_sheet_calc ("$samples/$file", "C2", sub { /No/i });
......@@ -8,5 +8,6 @@ use GnumericTest;
# See test_importer comments for mode definitions.
my $mode = ((shift @ARGV) || "check");
&message ("Check the sc importer.");
&test_importer ("$samples/sc/demo_func", "82e84c6e21c4aa3e70d9e05eb5d4d08ca1de810f", $mode);
&test_importer ("$samples/sc/demo_math", "8faad9c99be6a3202cfc5e1ebd77700b2a3264f1", $mode);
......@@ -8,4 +8,5 @@ use GnumericTest;
# See test_importer comments for mode definitions.
my $mode = ((shift @ARGV) || "check");
&message ("Check the Quattro Pro importer.");
&test_importer ("$samples/qpro/gantt.wb3", "481ba5e66d73a138e942a1bcff286caf304aeada", $mode);
......@@ -5,6 +5,7 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Check the core with valgrind.");
my $tmp = "statfuns.gnumeric";
&GnumericTest::junkfile ($tmp);
&test_valgrind ("$ssconvert --recalc $samples/excel/statfuns.xls $tmp", 1);
......@@ -5,5 +5,6 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Check that code does not fix NULL and FALSE.");
&test_command ("cd $topsrc && $PERL tools/check-null-false-returns",
sub { /^$/ });
......@@ -5,4 +5,5 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Check that code uses g_free and g_strdup right.");
&test_command ("cd $topsrc && $PERL tools/check-gfrees", sub { /^$/ });
......@@ -5,4 +5,5 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Check that glade files start out not visible.");
&test_command ("cd $topsrc && $PERL tools/check-glade-visible", sub { /^$/ });
......@@ -5,8 +5,12 @@ use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Warnings about things that might affect tests.");
my $HOME = exists $ENV{'HOME'};
print STDERR "Warning: tests are run using installed plugins. (\"make install\".)\n";
print STDERR "Warning: you have a ~/.valgrindrc file that might affect tests.\n"
if exists $ENV{'HOME'} && -r ($ENV{'HOME'} . "/.valgrindrc");
if defined ($HOME) && -r "$HOME/.valgrindrc";
print STDERR "Pass\n";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment