From cc99551cb2d93bea818df3e358c9ca663ea9bed4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20A=2E=20Holm?= Date: Mon, 22 Sep 2008 18:58:29 +0200 Subject: [PATCH] =?utf8?q?Legger=20inn=20tester=20for=20alle=20perlscripte?= =?utf8?q?ne=20i=20/trunk/=20(ikke=20underkataloger)=20som=20har=20mergesv?= =?utf8?q?n=20til=20Lib/std/perl=20definert.=20De=20skal=20v=C3=A6re=20rim?= =?utf8?q?elig=20oppdaterte.=20Ble=20laget=20med?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit for f in `cat ~/liste `; do std perl-tests $f.t -t progname=$f -t exec=../$f -t testcmd=$f.t; done * /trunk/tests/ Ny katalog. * /trunk/tests/access_log2tab.t * /trunk/tests/afv.t * /trunk/tests/create_new.t * /trunk/tests/csv2gpx.t * /trunk/tests/dbk.t * /trunk/tests/enc-mp4.t * /trunk/tests/find_inv_utf8.t * /trunk/tests/finduuid.t * /trunk/tests/fromhex.t * /trunk/tests/html2db.t * /trunk/tests/klokke.t * /trunk/tests/mailfix.t * /trunk/tests/manyfiles.t * /trunk/tests/mvdirnewest.t * /trunk/tests/pingstat.t * /trunk/tests/pmsetdate.t * /trunk/tests/scrplay.t * /trunk/tests/std.t * /trunk/tests/sumdup.t * /trunk/tests/svnfiledate.t * /trunk/tests/svnlog2tab.t * /trunk/tests/svnstat.t * /trunk/tests/tohex.t * /trunk/tests/wlan-list.t * /trunk/tests/xml2html.t * /trunk/tests/zeropad.t * /trunk/tests/zerosplit.t Tror alle de gikk rett inn uten forandringer. * /trunk/tests/suuid.t Den måtte skrues litt på iom at den har ustandard oppførsel. "-v/--version" brukes til uuid-versjon, og da forsvinner -v for --verbose, og --version forandres til --show-version. Er for å være litt kompatibel med uuid(1). * /trunk/std Den måtte forandres på, var en $ARGV[]-sjekk som var plassert for tidlig, så --verbose funka ikke med --help. a659e9c8-88c7-11dd-82ec-000475e441b9 git-svn-id: svn+ssh://svnhost/utils@2504 ddca7c6a-6bd8-0310-abd8-a0f6a7c394c1 --- tests/csv2gpx.t | 342 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 342 insertions(+) create mode 100755 tests/csv2gpx.t diff --git a/tests/csv2gpx.t b/tests/csv2gpx.t new file mode 100755 index 0000000..629f02a --- /dev/null +++ b/tests/csv2gpx.t @@ -0,0 +1,342 @@ +#!/usr/bin/perl -w + +#======================================================================= +# $Id: perl-tests 2502 2008-09-22 15:51:12Z sunny $ +# Test suite for csv2gpx(1). +# +# Character set: UTF-8 +# ©opyleft 2008– Øyvind A. Holm +# License: GNU General Public License version 2 or later, see end of +# file for legal stuff. +#======================================================================= + +BEGIN { + # push(@INC, "$ENV{'HOME'}/bin/STDlibdirDTS"); + our @version_array; + use Test::More qw{no_plan}; + # use_ok() goes here +} + +use strict; +use Getopt::Long; + +$| = 1; + +our $Debug = 0; +our $CMD = "../csv2gpx"; + +our %Opt = ( + 'all' => 0, + 'debug' => 0, + 'help' => 0, + 'todo' => 0, + 'verbose' => 0, + 'version' => 0, +); + +our $progname = $0; +$progname =~ s/^.*\/(.*?)$/$1/; + +my $rcs_id = '$Id: perl-tests 2502 2008-09-22 15:51:12Z sunny $'; +my $id_date = $rcs_id; +$id_date =~ s/^.*?\d+ (\d\d\d\d-.*?\d\d:\d\d:\d\d\S+).*/$1/; + +push(@main::version_array, $rcs_id); + +my @cmdline_array = @ARGV; + +Getopt::Long::Configure("bundling"); +GetOptions( + "all|a" => \$Opt{'all'}, + "debug" => \$Opt{'debug'}, + "help|h" => \$Opt{'help'}, + "todo|t" => \$Opt{'todo'}, + "verbose|v+" => \$Opt{'verbose'}, + "version" => \$Opt{'version'}, +) || die("$progname: Option error. Use -h for help.\n"); + +$Opt{'debug'} && ($Debug = 1); +$Opt{'help'} && usage(0); +if ($Opt{'version'}) { + print_version(); + exit(0); +} + +diag(sprintf("========== Executing \"%s%s%s\" ==========", + $progname, + scalar(@cmdline_array) ? " " : "", + join(" ", @cmdline_array))); + +if ($Opt{'todo'} && !$Opt{'all'}) { + goto todo_section; +} + +=pod + +testcmd("$CMD command", # {{{ + <); + close(FP); + return($Txt); + } else { + return undef; + } + # }}} +} + +sub print_version { + # Print program version {{{ + for (@main::version_array) { + print("$_\n"); + } + # }}} +} # print_version() + +sub usage { + # Send the help message to stdout {{{ + my $Retval = shift; + + if ($Opt{'verbose'}) { + print("\n"); + print_version(); + } + print(<= $verbose_level) { + print(STDERR "$progname: $Txt\n"); + } + # }}} +} # msg() + +__END__ + +# Plain Old Documentation (POD) {{{ + +=pod + +=head1 NAME + +run-tests.pl + +=head1 REVISION + +$Id: perl-tests 2502 2008-09-22 15:51:12Z sunny $ + +=head1 SYNOPSIS + +csv2gpx.t [options] [file [files [...]]] + +=head1 DESCRIPTION + +Contains tests for the csv2gpx(1) program. + +=head1 OPTIONS + +=over 4 + +=item B<-a>, B<--all> + +Run all tests, also TODOs. + +=item B<-h>, B<--help> + +Print a brief help summary. + +=item B<-t>, B<--todo> + +Run only the TODO tests. + +=item B<-v>, B<--verbose> + +Increase level of verbosity. Can be repeated. + +=item B<--version> + +Print version information. + +=item B<--debug> + +Print debugging messages. + +=back + +=head1 AUTHOR + +Made by Øyvind A. Holm Ssunny@sunbase.orgE>. + +=head1 COPYRIGHT + +Copyleft © Øyvind A. Holm Esunny@sunbase.orgE +This is free software; see the file F for legalese stuff. + +=head1 LICENCE + +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 the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +=head1 SEE ALSO + +=cut + +# }}} + +# vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w : +# End of file $Id: perl-tests 2502 2008-09-22 15:51:12Z sunny $ -- 2.11.4.GIT