Commit graph

53 commits

Author SHA1 Message Date
afd2418d73 Bug 11349: Change .tmpl -> .tt in scripts using templates
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.

This patch changes the occurences of '.tmpl' in favour of '.tt'.

To test:
- Apply the patch
- Install koha, and verify that every page can be accesed

Regards
To+

P.S. a followup will remove the glue code.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-07-17 11:05:49 -03:00
Robin Sheat
645cd2d240 Bug 12041 - POD fixing followup
This fixes a minor POD error detected, and also adds the Koha/ directory
to the regular test case so that the in-repo tests can find these
things.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-06-19 13:05:15 -03:00
Galen Charlton
b97e691ef8 Bug 12271: (follow-up) teach valid-templates.t how to include specified templates
Two of the template includes in the Bootstrap theme cannot be tested
all by themselves because they require that the template that includes
them define BLOCKs.  This patch ensures that they are excluded
from individual testing; they will get exercised sufficiently by being
including by all of the other Bootstrap templates.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 16:14:28 +00:00
8bc2fb4df6 Bug 12271: add Bootstrap templates to valid-templates.t tests
valid-templates.t actually tests the templates and includes of only
the "prog" theme at opac and intranet.  It does not test the opac
templates and includes of bootstrap theme, nor ccsr.  This is critical
since this test is used for patch integrations in release maintenance.

This patch adds the test of bootstrap opac theme.
I did not manage to add the ccsr theme since it is not a real theme,
meaning it has no templates and not all includes.

Test by runnning perl xt/author/valid-templates.t and looking at the
logs.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Now there are 902 lines, bootstrap tested (1 error detected!)
No koha-qa errors

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-19 15:58:04 +00:00
Galen Charlton
9a7eedce78 Bug 12076: better detect an untranslatable template construct
Per bug 6458, template constructs of the form

<li [% IF (foo) %]selected="selected"[% END %]...

are forbidden as they can cause problems with translated templates.
However, the tt_valid.t test currently doesn't catch the variation
where '-' is used to suppress extra whitespace:

<li [%- IF (foo) -%]selected="selected"[%- END -%]...

This patch corrects the issue.

To test:

[1] Temporarily add the following line to a template file:

<li [%- IF a -%]a="a"[%- END -%] />

[2] Run prove -v xt/tt_valid.t.  Note that no error is reported.
[3] Apply the patch, and rerun the tt_valid.t test.  This time,
    an error should be reported.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Works well, detects the forbidden pattern
No koha-qa errors.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-12 17:57:35 +00:00
1b80e77f84 Bug 11304: fix display of detail page holdings tab in translated Bootstrap theme
Detail page tabs are not displayed properly because JavaScript is broken
in French. This is due to _(' JS string construction used in place of
_(".

This patch fixes:

  - opac-detail.tt page
  - xt/single_quotes to test bootstrap theme

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by applying the patch, running translate update, then translate
install. Saw no JavaScript error on the French detail page.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Switches from single to double quotes for translatatable strings.
Unit tests for xt/single_quotes passes now.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-27 16:52:02 +00:00
Robin Sheat
c9172f49c8 Bug 9802 - add test case to ensure man pages have correct XML
To test:
* run xt/verify-debian-docbook.t and make sure it's all OK
* modify an xml file in debian/docs, try again, make sure it fails

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
- Running "prove -v xt/verify-debian-docbook.t" loops through all the
  XML files in debian/docs and reports them as being ok.
- Removing a "<" from one of the files makes the test report it as
  an error
- I did not verify that the test actually trips up a package build
  if there is invalid XML.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-20 15:11:10 -04:00
27a3d08331 Bug 8942 : Adding a test to make sure we don't use single quotes for js
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Tested by adding single quotes to a translation-escaped string.
Test correctly failed it.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-02-24 10:28:33 -05:00
9923f65dc2 Bug 8470: remove depreciated H:T:P test
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-26 14:53:13 +02:00
Chris Cormack
3f12a40af6 Bug 5327 : Follow up for TTParser test 2012-07-12 16:06:21 +02:00
Duncan Tyler
8c687edb66 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-07-12 16:06:20 +02:00
Paul Poulain
4fcaa4d31e Revert "Added coverage to unit test for TTParser"
This reverts commit 628788ad8a.
2012-07-06 17:00:48 +02:00
Duncan Tyler
628788ad8a 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>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-07-06 11:35:20 +02:00
Claire Hernandez
6ee7ad02aa Bug 7994: scripts to check yaml files
$ prove yaml_valid.t
checks a closed list of files
$ perl yaml_valid.pl -f myfile.yaml
try to load a yaml file with YAML::LoadFile and show errors

(both files pertidied)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2012-06-20 21:07:46 +02:00
Jared Camins-Esakov
d23b5920ac Bug 8022: Permissions test doesn't check all languages
Add the permissions files for es-ES and nb-NO to the permissions test.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Running xt/permissions.t before the patch leaves out nb-NO and es-ES.
After the patch they are picked up and the test fails correctly
because of the missing permissions described in Bug 7984.
As far as I can tall, all permission files are now picked up by
this test.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-14 15:05:16 +02:00
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