Commit graph

38 commits

Author SHA1 Message Date
Paul Poulain
1ffbd262b3 Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-15 13:55:48 +01:00
Paul Poulain
4fa0e4c88c Revert "Added coverage to unit test for TTParser"
This reverts commit 77c4307176.
2012-02-15 13:55:32 +01:00
Paul Poulain
6f6bfb8aff Merge remote-tracking branch 'origin/new/bug_5327' 2012-02-15 10:49:53 +01:00
Duncan Tyler
77c4307176 Added coverage to unit test for TTParser
http://bugs.koha-community.org/show_bug.cgi?id=5327
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test passes.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2012-02-15 10:47:25 +01:00
MJ Ray
d4b132136c Bug 7476 Remove executable bit from files that probably should not be executed
Signed-off-by: Aleksa Vujicic <aleksa@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended to replace some copy-and-paste comments only with consent of MJR.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-02-03 14:22:15 +01:00
Chris Cormack
2cfb891c83 Bug 929 : Follow up to allow tests to check plugins too
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl xt/author/valid-templates.t runs without errors now.
2012-01-16 18:18:11 +01:00
Paul Poulain
c95cbce4ce fixing the translatable-template.t to handle localized setups
Depending on your locale, msgmerge will return a different messages, enclosed in .... and .
The flow is not utf8 compliant, so this patch switches to testing "..... anything." instead of ".... word."

Now the test work on my (french setup)
2011-11-28 12:13:42 +01:00
Magnus Enger
6bd38d3eab Bug 6537 - squashed version of the previous 5 commits, signed-off
Bug 6537 - Move installer/data/mysql/en/mandatory/sysprefs.sql to installer/data/mysql/sysprefs.sql

Bug 6537 - Make the web installer use installer/data/mysql/sysprefs.sql

Bug 6537 - New syspref files with only the prefs that differ from the default

I have mostly deleted old syspref files and created new ones, with a new name,
mainly in order to reduce the risk of merge conflicts if the old syspref files
are changed before this patch is pushed, if it is pushed.

See http://wiki.koha-community.org/wiki/Simplified_syspref_handling_RFC for
a description of how the new files were created to reflect sysprefs that
differ from the global default.

.txt files have been moved to reflect the new names of the SQL files they are
associated with.

Bug 6537 - Remove syspref-related tests in xt/

As far as I can see, the previous patches for this bug makes the syspref tests
obsolete, and this patch removes them:

xt/syspref.t
xt/check_sysprefs.t

Bug 6537 - Fix a problem in French syspref file

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-09-07 09:19:07 +12:00
a41100a445 Bug 6458 Template Toolkit files test case
This test validate Template Toolkit (TT) Koha files.

For the time being an unique validation is done: Test if TT files
contain TT directive within HTML tag. For example:

  <li[% IF

This kind of constuction MUST be avoided because it break Koha
translation process.

This patch transform also translation specific modules into C4 modules
in order to be able to use them in test case:

  C4::TTPaser
  C4::TmplToken
  C4::TmplTokenType

This patch is a Perl adaptation of a Haskell script from Frère Sébastien
Marie.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on testing:
- translate install de-DE - worked ok
- translate update de-DE > translate install de-DE - worked ok
- running the test xt/tt_valid.t - worked ok and pointed out lots of problems.
Found no problems.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-18 21:11:50 +12:00
9fd4ff61d8 Bug 6316 - es-ES inclusion - Last fixes
Added diverged sysprefs, and added es-ES to the test list in xt/syspref.t

Yay!
To+

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-08-05 10:20:35 +12:00
Chris Cormack
c2a5e0fd45 Rewriting the valid templates test to test template toolkit 2011-04-29 11:33:19 +12:00
Chris Cormack
7c97e0bfe7 Fixing a utf8 issue with the translator tests 2011-03-06 08:05:40 +13:00
Chris Cormack
24db3d4a44 Fixing the translatable tests to work in french locales 2011-03-04 12:31:48 +13:00
Chris Cormack
423138606e Updating test for systprefs to give more useful output 2010-12-12 20:48:56 +13:00
ce5e2429db fixing various links to point to *.koha-community.org
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-21 22:08:24 -04:00
990eb589d6 add Italian installer SQL to test cases
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-12 10:18:46 -04:00
Chris Nighswonger
b647f01f51 Adding a temporary workaround to keep template tests from borking on very large templates
NOTE: This should be properly fixed at some point in 3.4

This may help:

http://www.perlmonks.org/?node_id=150748

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-10-07 07:07:50 -04:00
7c0e441d50 replace references to defunct info email address
Now links to Koha project website.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-25 05:18:44 -04:00
d40488fe65 fixes to xt/sysprefs.t test case
* use root of source tree as base directory
* ignore case when comparing system preference codes;
  at present this is also case-insenstive in the database
* added German sysprefs file
* corrected paths to Russian and Ukrainian system preference files

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-19 15:56:07 -04:00
05ca029055 fixed problems in xt/permissions.t test case
* now looks for permissions SQL files in the current
  source tree, not in intranetdir; tests in xt/ and
  t/ are meant to be run without requiring a full Koha
  installation
* added path to German
* fixed paths to permissions SQL for Russian and Ukrainian
* handles case where SQL script contains more than just
  inserts into to permissions

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-06-19 15:48:28 -04:00
ef58c445d3 removed needless imports of the YAML module
Removed instances of 'use YAML' that were either completely
unnecessary or which were used only in debug code.  Also
removed a needless import of Data::Dumper.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 23:30:48 -04:00
64daee5495 fix a common "developement" typo
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-25 14:38:38 -04:00
0d8b67e73c exclude TinyMCE from non-UTF8 file checks
Since Koha otherwise had made no modifications to the TinyMCE,
we'll leave it alone.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-06 19:55:44 -04:00
1aebed5dc8 move misc source file test and fix scripts to xt/
The license and non-UTF8 file checks are closer to
author tests and don't really belong at the top level of the
Koha source tree.  Follow-up might be to converted them
to test cases in xt/author that can be run by prove(1).

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-05-06 19:46:51 -04:00
Lars Wirzenius
4ec10c0a6e Fix FSF address in directory xt/
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-03-16 20:17:54 -04:00
46b4f60255 Add pl-PL to syspref test
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-20 17:51:11 -05:00
597bb1bb65 Bug 3609 Test for user permissions translated values
This new test identifies incoherences between 'en' user permissions and
translated versions.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-20 17:51:06 -05:00
9c7d9b0934 new test script to help debug template errors
From the POD:

NAME

show-template-structure.pl

DESCRIPTION

This script displays the structure of loops and conditional statements in
an HTML::Template::Pro template, and is an aid for debugging errors
reported by the xt/author/valid-templates.t test.  It also identifies the
following errors:

* TMPL_IF/TMPL_UNLESS/TMPL_LOOP with no closing tag
* TMPL_ELSE with no initial TMPL_IF or TMPL_UNLESS
* extra closing tags
* HTML comment of the form <!-- TMPL_FOO ..., where TMPL_FOO is not a valid HTML::Template::Pro tag

USAGE

xt/author/show-template-structure.pl path/to/template.tmpl

Output is sent to STDOUT.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2010-02-14 18:09:33 -05:00
Henri-Damien LAURENT
b00aa41234 MT2637, Follow-up : Adds a test to check for missing sysprefs in the database
Adds a non-test mode (--showsql option) that displays the missing sysprefs as sql inserts.
Some sysprefs were missed from the syspref file due to extra spaces in the insert : fixed.
The test now checks if there are at least as many sysprefs in the database as in the syspref file (instead of checking for the exact number)
2010-01-28 15:11:56 +01:00
5fc23f3fde Test case identifying incoherences between 'en' sysprefs and translated ones
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-08-19 21:56:43 -04:00
Galen Charlton
a50c16bae2 new author test for syntax errors in HTML templates
Added a new author test to look for syntax errors
in the HTML templates.  Run by doing

prove xt/author/valid-templates.t

from the root of a Koha source tree.

This test will help catch the following errors:

* unbalanced TMPL_IF, TMPL_UNLESS, and TMPL_LOOP contructs, e.g.,
  cases where a TMPL_IF is not closed by a /TMPL_IF.
* references to nonexistant include files
* syntax errors within a HTML::Template::Pro tag

This test currently ignores errors related to TMPL_IF EXPR, which
is currently deprecated for use in Koha -- this may be made
stricter in the future.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-05-01 16:21:47 -05:00
Galen Charlton
da13a339bb moved Test_CSV_Various.t to xt/author
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2008-11-17 10:19:43 -06:00
Andrew Moore
e9b7ce803f adding pod spelling test
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-10 09:10:40 -05:00
Galen Charlton
e0a9c58be7 bug 2295 [followup 1/2]: added name to one of tests in icondirectories.t
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-07 16:32:32 -05:00
Andrew Moore
599b3b5999 bug 2295 [2/4]: moving icondirectories.t from t to xt
the icondirectories.t test depends on the database, so it needed to be
moved. But, it's really more of an author test since it's testinging the
correct structure of our distribution, so I'm moving it to xt/author.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-07 16:32:29 -05:00
Andrew Moore
c0279eab5f bug: 2269 - adding a perltidyrc file
This patch adds xt/perltidyrc, a suggested perltidy configuration file.

It's in the xt directory because I'd like to eventually tie it in with Test::Perl::Critic
to run automated tests on tidyness and other Perl::Critic policies. That stuff belongs in
the xt directory since it's testing for developers use only.

I have only turned on a few directives based on the suggestions by MJ, historical discussion on
the mailing lists, and what I was told when I started contributing to koha. There are many other
directives in this file that are commented out. They are supposed to represent the defaults and
can be adjusted in the future if desired.

Use of this file is encouraged, but not required. It would be really nice if you could at least run
it on new files that you contribute. I would recommend not running it on files that are already
part of koha without writing some tests for those files and discussing your intentions to reformat
entire files in bulk.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-25 11:47:30 -05:00
Galen Charlton
5122c4b1d8 new automated test for template translatability
This test verifies that the English OPAC and staff templates
can be processed by the string extractor (tmpl_process3.pl)
without error.  If a template contains a parsing error
(at least as far as tmpl_process3.pl is concerned), it may
not be correctly converted when a language translation
is applied.

To run this test, do

prove -v xt/author/translatable-templates.t

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-23 10:34:31 -05:00
Andrew Moore
115bb8252a Adding an automated test for POD correctness.
This test script checks all perl files in the C4 directory for POD correctness. It is
completely optional, and as of yet, is not actually run when you run the test suite.
It's just a handy way to check our POD documentation, which should be correct before
we release code.

This script can be invoked with 'prove -v xt/author/podcorrectness.t'

Additionally, this is the first test in the 'xt' directory. Current perl testing practices
have reserved the 'xt' directory for tests that should be run by the code authors before
release. See:
http://perl-qa.hexten.net/wiki/index.php/Oslo_QA_Hackathon_2008_:Achievements#Testing_Best_Practices
for more information.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-06-20 13:04:56 -05:00