lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6091] Extract output_file_existence_checker into a separa


From: Greg Chicares
Subject: [lmi-commits] [6091] Extract output_file_existence_checker into a separate header
Date: Fri, 23 Jan 2015 02:35:25 +0000

Revision: 6091
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6091
Author:   chicares
Date:     2015-01-23 02:35:25 +0000 (Fri, 23 Jan 2015)
Log Message:
-----------
Extract output_file_existence_checker into a separate header

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/wx_test_validate_output.cpp

Added Paths:
-----------
    lmi/trunk/wx_test_output.hpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-01-23 02:13:16 UTC (rev 6090)
+++ lmi/trunk/ChangeLog 2015-01-23 02:35:25 UTC (rev 6091)
@@ -35550,3 +35550,10 @@
 Prefer calendar_date to wxDateTime. See:
   http://lists.nongnu.org/archive/html/lmi/2014-12/msg00085.html
 
+20150123T0235Z <address@hidden> [516]
+
+  wx_test_output.hpp [new file]
+  wx_test_validate_output.cpp
+Extract output_file_existence_checker into a separate header. See:
+  http://lists.nongnu.org/archive/html/lmi/2014-12/msg00089.html
+

Added: lmi/trunk/wx_test_output.hpp
===================================================================
--- lmi/trunk/wx_test_output.hpp                                (rev 0)
+++ lmi/trunk/wx_test_output.hpp        2015-01-23 02:35:25 UTC (rev 6091)
@@ -0,0 +1,69 @@
+// Helpers for working with output files in wx test suite.
+//
+// Copyright (C) 2015 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifndef wx_test_output_hpp
+#define wx_test_output_hpp
+
+#include "config.hpp"
+
+#include "uncopyable_lmi.hpp"
+
+#include <boost/filesystem/operations.hpp>
+
+/// Class helping to check for the expected output file existence.
+///
+/// This class takes care of ensuring that the file doesn't exist when it is
+/// constructed and provides a way to check for the existence of the file
+/// later. It also cleans up the file when it is destroyed.
+
+class output_file_existence_checker
+    :private lmi::uncopyable<output_file_existence_checker>
+{
+  public:
+    output_file_existence_checker(std::string const& path)
+        :path_(path)
+        {
+        fs::remove(path_);
+        }
+
+    bool exists() const
+        {
+        return fs::exists(path_);
+        }
+
+    ~output_file_existence_checker()
+        {
+        try
+            {
+            fs::remove(path_);
+            }
+        catch(...)
+            {
+            }
+        }
+
+  private:
+    fs::path path_;
+};
+
+#endif // wx_test_output_hpp


Property changes on: lmi/trunk/wx_test_output.hpp
___________________________________________________________________
Added: svn:keywords
   + Id

Modified: lmi/trunk/wx_test_validate_output.cpp
===================================================================
--- lmi/trunk/wx_test_validate_output.cpp       2015-01-23 02:13:16 UTC (rev 
6090)
+++ lmi/trunk/wx_test_validate_output.cpp       2015-01-23 02:35:25 UTC (rev 
6091)
@@ -32,53 +32,11 @@
 #include "uncopyable_lmi.hpp"
 #include "wx_test_case.hpp"
 #include "wx_test_new.hpp"
+#include "wx_test_output.hpp"
 
 #include <wx/testing.h>
 #include <wx/uiaction.h>
 
-#include <boost/filesystem/operations.hpp>
-
-namespace
-{
-
-/// Class helping to check for the expected output file existence.
-///
-/// This class takes care of ensuring that the file doesn't exist when it is
-/// constructed and provides a way to check for the existence of the file
-/// later. It also cleans up the file when it is destroyed.
-
-class output_file_existence_checker
-    :private lmi::uncopyable<output_file_existence_checker>
-{
-  public:
-    output_file_existence_checker(std::string const& path)
-        :path_(path)
-        {
-        fs::remove(path_);
-        }
-
-    bool exists() const
-        {
-        return fs::exists(path_);
-        }
-
-    ~output_file_existence_checker()
-        {
-        try
-            {
-            fs::remove(path_);
-            }
-        catch(...)
-            {
-            }
-        }
-
-  private:
-    fs::path path_;
-};
-
-} // Unnamed namespace.
-
 /*
     Add test to validate existence of the expected output files.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]