[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [6078] Skip distribution tests more elegantly
From: |
Greg Chicares |
Subject: |
[lmi-commits] [6078] Skip distribution tests more elegantly |
Date: |
Mon, 15 Dec 2014 14:16:38 +0000 |
Revision: 6078
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6078
Author: chicares
Date: 2014-12-15 14:16:38 +0000 (Mon, 15 Dec 2014)
Log Message:
-----------
Skip distribution tests more elegantly
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/main_wx_test.cpp
lmi/trunk/wx_test_case.hpp
lmi/trunk/wx_test_config_settings.cpp
lmi/trunk/wx_test_default_input.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-12-15 14:06:13 UTC (rev 6077)
+++ lmi/trunk/ChangeLog 2014-12-15 14:16:38 UTC (rev 6078)
@@ -34919,3 +34919,12 @@
Implement rectified test specification. See:
http://lists.nongnu.org/archive/html/lmi/2014-12/msg00075.html
+20141215T1416Z <address@hidden> [516]
+
+ main_wx_test.cpp
+ wx_test_case.hpp
+ wx_test_config_settings.cpp
+ wx_test_default_input.cpp
+Skip distribution tests more elegantly. See:
+ http://lists.nongnu.org/archive/html/lmi/2014-12/msg00076.html
+
Modified: lmi/trunk/main_wx_test.cpp
===================================================================
--- lmi/trunk/main_wx_test.cpp 2014-12-15 14:06:13 UTC (rev 6077)
+++ lmi/trunk/main_wx_test.cpp 2014-12-15 14:16:38 UTC (rev 6078)
@@ -566,6 +566,14 @@
return application_test::instance().is_distribution_test();
}
+void wx_base_test_case::skip_if_not_distribution()
+{
+ if(!is_distribution_test())
+ {
+ throw test_skipped_exception("not running distribution tests");
+ }
+}
+
// Application to drive the tests
class SkeletonTest : public Skeleton
{
Modified: lmi/trunk/wx_test_case.hpp
===================================================================
--- lmi/trunk/wx_test_case.hpp 2014-12-15 14:06:13 UTC (rev 6077)
+++ lmi/trunk/wx_test_case.hpp 2014-12-15 14:16:38 UTC (rev 6078)
@@ -80,10 +80,19 @@
/// Return true if running in distribution testing mode.
///
- /// This method is used to restrict execution of the tests that are
- /// specific to the binary program distribution.
+ /// This method is used to partially skip execution of the tests that are
+ /// specific to the binary program distribution. If the entire test should
+ /// be skipped, prefer to use skip_if_not_distribution() instead.
bool is_distribution_test() const;
+ /// Skip the test if not running in distribution testing mode.
+ ///
+ /// This method can be used to skip execution of a test entirely unless
+ /// --distribution command line option was specified.
+ ///
+ /// Throws test_skipped_exception if the distribution option was not given.
+ void skip_if_not_distribution();
+
protected:
/// The argument must be a literal, as we just store the pointer.
explicit wx_base_test_case(char const* name);
Modified: lmi/trunk/wx_test_config_settings.cpp
===================================================================
--- lmi/trunk/wx_test_config_settings.cpp 2014-12-15 14:06:13 UTC (rev
6077)
+++ lmi/trunk/wx_test_config_settings.cpp 2014-12-15 14:16:38 UTC (rev
6078)
@@ -82,10 +82,7 @@
LMI_WX_TEST_CASE(configurable_settings)
{
- if(!is_distribution_test())
- {
- return;
- }
+ skip_if_not_distribution();
LMI_ASSERT(fs::exists("/etc/opt/lmi/configurable_settings.xml"));
Modified: lmi/trunk/wx_test_default_input.cpp
===================================================================
--- lmi/trunk/wx_test_default_input.cpp 2014-12-15 14:06:13 UTC (rev 6077)
+++ lmi/trunk/wx_test_default_input.cpp 2014-12-15 14:16:38 UTC (rev 6078)
@@ -64,10 +64,7 @@
LMI_WX_TEST_CASE(default_input)
{
- if(!is_distribution_test())
- {
- return;
- }
+ skip_if_not_distribution();
Input const& cell = default_cell();
calendar_date effective_date;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [6078] Skip distribution tests more elegantly,
Greg Chicares <=