[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5985] Test configurable_settings.xml file.
From: |
Vadim Zeitlin |
Subject: |
[lmi-commits] [5985] Test configurable_settings.xml file. |
Date: |
Tue, 14 Oct 2014 23:25:48 +0000 |
Revision: 5985
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5985
Author: zeitlin
Date: 2014-10-14 23:25:47 +0000 (Tue, 14 Oct 2014)
Log Message:
-----------
Test configurable_settings.xml file.
Implement the following verifications from the official specification:
1. Inspect 'configurable_settings.xml' for the following:
A. The file exists in '/etc/opt/lmi'
B. These lines always exist like this:
<libraries_to_preload/>
<xsl_fo_command>CMD /c /fop-0.20.5/fop</xsl_fo_command>
C. We package several distributions each month that have their
own "skin" and "default" files. Each time this test is run,
only one pair of the following lines exists at a time:
<skin_filename>skin_coli_boli.xrc</skin_filename>
<default_input_filename>c:/fop-0.20.5/coli_boli_default.ill</default_input_filename>
<skin_filename>skin_group_carveout.xrc</skin_filename>
<default_input_filename>c:/fop-0.20.5/group_carveout_default.ill</default_input_filename>
<skin_filename>skin_group_carveout2.xrc</skin_filename>
<default_input_filename>c:/fop-0.20.5/group_carveout_default.ill</default_input_filename>
<skin_filename>reg_d.xrc</skin_filename>
<default_input_filename>c:/fop-0.20.5/private_placement_default.ill</default_input_filename>
The only change is that the xsl_fo_command is checked to contain the volume,
i.e. is c:/fop-0.20.5/fop, and not just the path.
Modified Paths:
--------------
lmi/trunk/main_wx_test.cpp
Modified: lmi/trunk/main_wx_test.cpp
===================================================================
--- lmi/trunk/main_wx_test.cpp 2014-10-12 15:25:33 UTC (rev 5984)
+++ lmi/trunk/main_wx_test.cpp 2014-10-14 23:25:47 UTC (rev 5985)
@@ -27,6 +27,7 @@
#endif
#include "assert_lmi.hpp"
+#include "configurable_settings.hpp"
#include "force_linking.hpp"
#include "main_common.hpp" // initialize_application()
#include "msw_workarounds.hpp"
@@ -34,6 +35,8 @@
#include "skeleton.hpp"
#include "version.hpp"
+#include <boost/filesystem/operations.hpp>
+
#include <wx/dialog.h>
#include <wx/init.h> // wxEntry()
#include <wx/testing.h>
@@ -52,10 +55,12 @@
static void test()
{
test_about_dialog_version();
+ test_configurable_settings();
}
private:
static void test_about_dialog_version();
+ static void test_configurable_settings();
};
void application_test::test_about_dialog_version()
@@ -81,6 +86,38 @@
);
}
+void application_test::test_configurable_settings()
+{
+ LMI_ASSERT(fs::exists("/etc/opt/lmi/configurable_settings.xml"));
+
+ configurable_settings const& settings = configurable_settings::instance();
+ LMI_ASSERT("" == settings.libraries_to_preload());
+ LMI_ASSERT("CMD /c c:/fop-0.20.5/fop" == settings.xsl_fo_command());
+
+ std::string skin = settings.skin_filename();
+ std::string default_input = settings.default_input_filename();
+ LMI_ASSERT( "skin_coli_boli.xrc" == skin
+ || "skin_group_carveout.xrc" == skin
+ || "skin_group_carveout2.xrc" == skin
+ || "reg_d.xrc" == skin);
+ if ("skin_coli_boli.xrc" == skin)
+ {
+ LMI_ASSERT("c:/fop-0.20.5/coli_boli_default.ill" == default_input);
+ }
+ if ("skin_group_carveout.xrc" == skin)
+ {
+ LMI_ASSERT("c:/fop-0.20.5/group_carveout_default.ill" ==
default_input);
+ }
+ if ("skin_group_carveout2.xrc" == skin)
+ {
+ LMI_ASSERT("c:/fop-0.20.5/group_carveout_default.ill" ==
default_input);
+ }
+ if ("reg_d.xrc" == skin)
+ {
+ LMI_ASSERT("c:/fop-0.20.5/private_placement_default.ill" ==
default_input);
+ }
+}
+
// Application to drive the tests
class SkeletonTest : public Skeleton
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5985] Test configurable_settings.xml file.,
Vadim Zeitlin <=