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>
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>
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)
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>
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>
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>
* 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>
* 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>
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>
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>
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>
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)
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>
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>
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>
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>
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>