[glom] Test creation from examples in non-English locales.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Test creation from examples in non-English locales.
- Date: Fri, 27 Jan 2012 10:21:16 +0000 (UTC)
commit a83bd81892abb982d382d8c75b80f38eb71f0d8d
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jan 27 10:19:56 2012 +0100
Test creation from examples in non-English locales.
* Makefile_tests.am:
* tests/test_selfhosting_new_from_example_in_locales.sh:
Run the test_selfhosting_new_from_example example in various
locales, to make sure that the libgda problem (see bug #668346),
or something like it, does not come back.
* tests/test_selfhosting_new_from_example.cc: Call setlocale().
ChangeLog | 11 ++++++++
Makefile_tests.am | 2 +
tests/test_selfhosting_new_from_example.cc | 5 ++++
...test_selfhosting_new_from_example_in_locales.sh | 26 ++++++++++++++++++++
4 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1947202..e011d65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-01-27 Murray Cumming <murrayc murrayc com>
+
+ Test creation from examples in non-English locales.
+
+ * Makefile_tests.am:
+ * tests/test_selfhosting_new_from_example_in_locales.sh:
+ Run the test_selfhosting_new_from_example example in various
+ locales, to make sure that the libgda problem (see bug #668346),
+ or something like it, does not come back.
+ * tests/test_selfhosting_new_from_example.cc: Call setlocale().
+
2012-01-25 Murray Cumming <murrayc murrayc com>
Document: Avoid accumulating old nodes in the XML.
diff --git a/Makefile_tests.am b/Makefile_tests.am
index e106728..c6ec279 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -69,6 +69,7 @@ TESTS = tests/test_document_load \
tests/test_fake_connection \
tests/test_selfhosting_new_empty \
tests/test_selfhosting_new_from_example \
+ tests/test_selfhosting_new_from_example_in_locales.sh \
tests/test_selfhosting_new_from_example_strangepath \
tests/test_selfhosting_new_then_report \
tests/test_selfhosting_new_then_backup_restore \
@@ -92,6 +93,7 @@ dist_noinst_SCRIPTS = tests/test_dtd_file_validation.sh \
tests/test_xslt_file_validation.sh \
tests/test_glade_toplevels_instantiation.sh \
tests/test_glom_date_in_locales.sh \
+ tests/test_selfhosting_new_from_example_in_locales.sh \
tests/test_document_load_and_save_all.sh
#TESTS_ENVIRONMENT=which valgrind && valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=30
diff --git a/tests/test_selfhosting_new_from_example.cc b/tests/test_selfhosting_new_from_example.cc
index 911cb2a..c607c88 100644
--- a/tests/test_selfhosting_new_from_example.cc
+++ b/tests/test_selfhosting_new_from_example.cc
@@ -61,6 +61,11 @@ static bool test(Glom::Document::HostingMode hosting_mode)
int main()
{
Glom::libglom_init();
+
+ //We run this test in several locales via
+ //test_selfhosting_new_from_example_in_locales.sh,
+ //so we do this so the locale will really be used:
+ setlocale(LC_ALL, "");
if(!test(Glom::Document::HOSTING_MODE_POSTGRES_SELF))
{
diff --git a/tests/test_selfhosting_new_from_example_in_locales.sh b/tests/test_selfhosting_new_from_example_in_locales.sh
new file mode 100755
index 0000000..fa016bb
--- /dev/null
+++ b/tests/test_selfhosting_new_from_example_in_locales.sh
@@ -0,0 +1,26 @@
+#/bin/sh -e
+
+# This test checks that creating from examples works in non-English locales.
+# This would break if libgda uses locale-dependent code to convert between numbers
+# and SQL text, as it has in the past.
+#
+# This test requires these locales to be installed and configured.
+# That might be a problem on some systems, so feel free to use a patch to edit this file or disable it altogether.
+#
+# These are chosen based on problems found previously,
+# and the ones with good translations shown here: http://l10n.gnome.org/module/glom/
+# TODO: Get a list from po/*.po ?
+#
+# On debian/Ubuntu do this:
+# sudo apt-get install language-pack-de language-pack-es language-pack-fi language-pack-fr language-pack-hu language-pack-it language-pack-pt language-pack-sl language-pack-da language-pack-cz language-pack-nb language-pack-se
+#
+# These are apparently not available on Fedora: "da_DK.UTF-8" "cs_CZ.UTF-8" "nb_NO.UTF-8" "sv_SE.UTF-8"
+locales=("en_US.UTF-8" "en_GB.UTF-8" "en_CA.UTF-8" "de_DE.UTF-8" "es_ES.UTF-8" "fi_FI.UTF-8" "fr_FR.UTF-8" "hu_HU.UTF-8" "it_IT.UTF-8" "pt_PT.UTF-8" "pt_BR.UTF-8" "sl_SI.UTF-8" "da_DK.UTF-8" "cs_CZ.UTF-8" "nb_NO.UTF-8" "sv_SE.UTF-8")
+
+for x in "${locales[ ]}"
+do
+ echo testing with LANG and LANGUAGE="$x"
+ export LANG="$x"
+ export LANGUAGE="$x"
+ tests/test_selfhosting_new_from_example || exit 1
+done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]