test_util.h

Go to the documentation of this file.
00001 /*
00002 This file is part of hugin.
00003 
00004 hugin is free software: you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation, either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 hugin is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with hugin.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00025 #ifndef TEST_UTIL_H_
00026 #define TEST_UTIL_H_
00027 
00028 namespace makefile { namespace tester {
00029 int exec_make(std::stringbuf& makeoutbuf, std::stringbuf& makeerrbuf);
00030 
00034 class Test
00035 {
00037         std::stringbuf makeoutbuf, makeerrbuf;
00039         const char* name;
00041         const char* goodout;
00042         bool result;
00043 public:
00045         Test(const char* name_, const char* goodout_)
00046         :name(name_), goodout(goodout_), result(false) {}
00048         virtual ~Test() {}
00050         virtual bool run();
00052         virtual bool precond()
00053         {
00054                 return true;
00055         }
00057         virtual bool eval()
00058         {
00059                 result = precond() && (goodout == makeoutbuf.str());
00060                 return result;
00061         }
00062 
00063 };
00064 }}
00065 #endif /* TEST_UTIL_H_ */

Generated on 23 Oct 2014 for Hugintrunk by  doxygen 1.4.7