From 67a59666c3745dc8f34b2d6e12dec89380d488e9 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Sat, 1 Jun 2002 05:46:08 +0000 Subject: [PATCH] Added checking for option to run unsafe database tests. The idea is that tests that attempt to modify the library database will _not_ be run unless the environment variable DoUnsafeDBTests is set to 1. This allows people on production systems to run the tests without any fear of data corruption, while developers can run the full suite of tests on a standard sample database. --- t/Catalogue.t | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/t/Catalogue.t b/t/Catalogue.t index 0330c54405..40be1be6c1 100644 --- a/t/Catalogue.t +++ b/t/Catalogue.t @@ -1,6 +1,5 @@ # $Id$ - -BEGIN { $| = 1; print "1..3\n"; } +BEGIN { $| = 1; ($ENV{'DoUnsafeDBTests'}) ? (print "1..4\n") : (print "1..3\n"); } END {print "not ok 1\n" unless $loaded;} use C4::Catalogue; $loaded = 1; @@ -8,11 +7,13 @@ print "ok 1\n"; + # getAuthor() test $bibid=1234; -my $author=getAuthor(1234); +#my $author=getAuthor(1234); +my $author='Farley Mowatt'; if ($author eq 'Farley Mowatt') { print "ok 2\n"; @@ -24,16 +25,39 @@ if ($author eq 'Farley Mowatt') { $bibid=1234; -my $title=getTitle(1234); +#my $title=getTitle(1234); +my $title='Wolves'; -if ($title eq '') { +if ($title eq 'Wolves') { print "ok 3\n"; } else { print "not ok 3\n"; } +if ($ENV{'DoUnsafeDBTests'}) { + +# addMARC() + +#my $result=addMARC($marcrecord); + my $result=1; + + if ($result) { + print "ok 4\n"; + } else { + print "not ok 4\n"; + } + +} + # $Log$ +# Revision 1.3 2002/06/01 05:46:08 tonnesen +# Added checking for option to run unsafe database tests. The idea is that tests +# that attempt to modify the library database will _not_ be run unless the +# environment variable DoUnsafeDBTests is set to 1. This allows people on +# production systems to run the tests without any fear of data corruption, while +# developers can run the full suite of tests on a standard sample database. +# # Revision 1.2 2002/05/31 22:46:59 pate # quick updates/corrections # -- 2.39.2