Commit graph

57 commits

Author SHA1 Message Date
Galen Charlton
33036c4ae4 test suite - various changes
* All configuration and run-time files created during
  a test suite run now live under t/run
* made sure scripts copied to t/run/bin are executable
* added t/run and t/test-config.txt to .gitignore

Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:26:30 -05:00
Galen Charlton
e46bceb305 test suite: removed dep on 'acm' user
Signed-off-by: Andrew Moore <andrew.moore@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:26:29 -05:00
Andrew Moore
d37e9712eb adding database-dependent test libs.
These test libs should have been included in the previous patch.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:26:28 -05:00
Andrew Moore
80568463ea improvements to automated tests, including a testing database
I'm adding a bunch of additions to the test suite. There is now a test
database that is created, and a test instance of the zebra server and
daemon that are run before the tests in t/database-dependent.pl are
run. This means that you can test things that insert (or destroy)
things in the database.

To use these tests, after you 'make' your koha installation, you can
change to the 't' directory and 'make test' there.

There is now an additional question asked during installation. It asks
whether you would like to run the data-dependent tests. If so, It asks
you for some login information to a test database. I recommend that
you do not not use your production database here. It will delete all
of the data in it.

Things that need improvement:
* I suspect that there are large parts that are not very platform
  independent, so they will need to be improved.
* There are some parts of the installer that will probably be
  refactored to let this work a little bit better, including being run
  directly from a main-level 'make' target at some point.
* Lots more tests to add. Be bold! (see the t/lib directory)
* other tests in t/*.t can possibly benefit from being included in here.

There are two required perl modules for this part of the test suite. I
use:
'Test::Class' => 0.028,
'Test::Class::Load' => 0.02,
They are not listed as requirements in the top-level Makefile.PL
because they're not actually required to install or use Koha, but if
you want to run the test suite, you can install them from CPAN.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-21 11:26:27 -05:00
Andrew Moore
a5325c4fcc use bind variables in C4::Acquisition::GetPendingOrders
I improved the tests a bit for this module so that they at least skip
if there's not enough data in the database to test with.
I was unable to test the actual execution path through the change I actually made.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-19 15:46:23 -05:00
Galen Charlton
60a98d258a IMPORTANT - refactor MARC character set handling
* IsStringUTF8ish - determine if scalar contains a string in UTF8
* MarcToUTF8Record - convert MARC blob or MARC::Record to UTF8
* SetMarcUnicodeFlag - set appropriate MARC21 or UNIMARC field to
  indicate that record is in UTF-8.

Design points of this module include:

* No dependencies on other C4 modules, making it easier to add
  more test cases
* All character conversion code in one place
* Single entry point for doing a character conversion on a
  MARC record
* Capture of errors and warnings produced by Text::Iconv
  and MARC::Charset
* Start of support for guessing the source character set of
  a MARC record.

Several functions were moved from other scripts
or modules to C4::Charset:

* C4::Koha->FixEncoding (expanded and renamed
  MarcToUTF8Record)
* C4::Koha->char_decode5426
* fMARC8ToUTF8 from bulkmarcimport.pl (renamed
  _marc_marc8_to_utf8)

Several batch jobs were adjusted to use MarcToUTF8Record instead of
FixEncoding.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-02-03 07:23:56 -06:00
Joe Atzberger
a82d245fc6 C4::Debug - Centralized debug switches module, test and proof conversion (in Dates.pm)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-23 21:27:20 -06:00
Joe Atzberger
b52e6430fc Dates - remove extra newlines from carps, add partial "00" date tests to Dates.t
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-14 16:45:31 -06:00
Galen Charlton
5290ec5596 test suite cleanup
Many of the tests were failing or putting warnings
because a valid systempreferences table is
usaully absent by the time 'make test' is run.

Fortunately, only a few modules try to invoke
C4::Context->preference during module initialization,
so added to the test suite override_context_prefs.pm,
which replaces preference() with a sub to return
testing values for three variables: 'dateformat',
'marcflavour', and 'LibraryName'.

Also fixed bug in t/Boolean.t

With this patch and the patch to move the DB-dependent
tests off to the side for the moment, 'make test'
now runs cleanly, at least on Debian.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:08:02 -06:00
Galen Charlton
156cbf4eb6 DB-dependent tests moved
Moved test cases that depend on the DBMS and having
an initialized Koha database to a subdirectory
of t so that they will not be swept up into
the default 'make test'.  Goal is to have
these DB-dependent tests runnable either via
a special make target or perhaps from the
web installer.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:07:38 -06:00
Galen Charlton
a49b1e07bc t/Date.t - now uses Test::More
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:07:33 -06:00
Galen Charlton
d7d8e522db removed t/Charset.t
Functions being tested no longer exist

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:07:31 -06:00
Galen Charlton
1943e17d60 C4::Output tests -- removed inccorect tests
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:07:23 -06:00
Galen Charlton
809ea60d07 start of test suite for C4::Items
Only functions that do not touch the DB
are currently tested.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-03 16:26:55 -06:00
Joe Atzberger
aa7a90738a Dates.pm - IMPORTANT fix for dmy_array (part of obejct, not class)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-20 19:13:21 -06:00
Joe Atzberger
46ac9d4bfa rename ldap test file
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-13 17:34:14 -06:00
Joe Atzberger
8b54c061ae Auth.t - running this test will fail unless Auth.pm patches get trough.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 17:28:23 -06:00
Joe Atzberger
94c4c7c1f7 Auth_with_ldap : module and test final touches.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 17:28:21 -06:00
Joe Atzberger
a462c8939e LDAP - further integration
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 17:28:19 -06:00
Joe Atzberger
bfcc5b00f9 Dates.pm - ongoing integration, acqui/histsearch.pl
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 17:28:17 -06:00
Joe Atzberger
d88ecc0751 Big LDAP changes, module test for Context.pm, still more yet to come.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-12-04 17:27:06 -06:00
Joe Atzberger
ba0486aad6 LDAP test and example LDIF file.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 13:24:45 -06:00
Joe Atzberger
76ea4886c2 Auth_with_ldap.t - real test cases... work in progress
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 13:24:44 -06:00
Joe Atzberger
db28108a6b Input.t permissions fix
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-11-16 13:24:37 -06:00
Chris Cormack
b9c20fa9cf Patch from Galen Charlton, removing $Id$ $Log$ and $Revision$ from files
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-18 20:22:01 -05:00
Joe Atzberger
a1fe32d2f8 Total Test Overhaul! Most of these were stubs, and still are.
Input.t was replaced because it tested a now obsolete function.
Input.pm has that function commented out.
Several files were renamed to match their counterparts or
correct misspellingz.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-18 16:26:44 -05:00
Joe Atzberger
92dbfc6c9f Renamed file to match module. Trivial change.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-18 16:26:25 -05:00
Joe Atzberger
82f3a9423b Dates.pm: perl test to accompany Dates.pm functions.
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-17 07:01:06 -05:00
Joe Atzberger
bd76a1fb0f Context.pm fatalsToBrowser now dependent on $ENV{USER_AGENT}.
Minor adjustments to Dates.pm and associated test.  You should be able to run a
perl test that uses Context w/o getting fatalsToBrowser output.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-12 22:19:42 -05:00
Joe Atzberger
cd967a2db1 New object-oriented date module to soon replace Date.pm.
Also included is a traditional perl (t/Dates.t) test script.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2007-10-08 15:55:26 -05:00
Chris Cormack
bcf0c513fb Test for C4::Branch
Just skeletal at this stage, actual tests need to be added

Signed-off-by: Chris Cormack <crc@liblime.com>
2007-09-04 03:15:03 -05:00
MJ Ray
a5a419616d Disable tests
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-08-28 16:50:39 -05:00
Joshua Ferraro
6cdf0832e2 new virtual shelves changes, keyed by biblionumber
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-08-09 09:17:49 -05:00
Joshua Ferraro
d5acfe9d73 update to virtual shelves -- approved 2007-08-08 13:12:47 -05:00
Joshua Ferraro
812ba6cd9c working on virtual shelves cleanup, partially finished
Signed-off-by: Chris Cormack <crc@liblime.com>
2007-08-08 11:39:24 -05:00
rangi
289d578bec Adding more tests, it now tests the exported functions 2007-06-24 22:48:50 +00:00
rangi
979f09cdd6 Missed test 2007-06-18 07:28:58 +00:00
rangi
822b040577 Removing tes for deprecated function, of course there are a ton more
functions in here that need tests written for them
2007-06-18 03:26:54 +00:00
rangi
77618f43cf Finishing up the last of the tests 2007-06-18 03:20:19 +00:00
rangi
f30d3c79e3 Continuing on my tests mission 2007-06-18 01:58:24 +00:00
rangi
ccc8db346d More test files 2007-06-18 01:34:50 +00:00
rangi
07b3e3c952 Continuing to add tests 2007-06-18 00:51:10 +00:00
rangi
3e275d1217 Simple compile only test for C4::Amazon
Needs tests written for the 2 functions in it.
2007-06-17 23:44:04 +00:00
rangi
07902f96e8 Working on unit tests 2007-06-17 23:35:36 +00:00
tipaul
f8e9fb6445 rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
tipaul
86e9db4e67 rel_3_0 moved to HEAD (removing useless file) 2007-03-09 15:22:00 +00:00
acli
6157f1842b Convenience function to check for 1/0/true/false/on/off/yes/no 2003-02-06 06:15:00 +00:00
acli
52a5fd4bbd Moved C4/Charset.pm to C4/Interface/CGI/Output.pm
Create output_html_with_http_headers function to contain the "print $query
->header(-type => guesstype...),..." call. This is in preparation for
non-HTML output (e.g., text/xml) and charset conversion before output in
the future.

Created C4/Interface/CGI/Template.pm to hold convenience functions specific
to the CGI interface using HTML::Template

Modified moremembers.pl to make the "sex" field localizable for languages
where M and F doesn't make sense
2003-02-02 07:18:37 +00:00
acli
ea50c2acb6 Preliminary fix of the CGI.pm problem of always assuming that everything is
in ISO-8859-1.

A new C4::Charset module (tentative name) has been created to guess the
charset of a piece of HTML markup. The CGI programs will be modified to use
this module as they are encountered during translation.
2003-01-19 06:15:44 +00:00
tonnesen
a0df2d5ea3 Added a couple of tests. 2002-10-24 04:12:10 +00:00