00001 00004 /* Copyright 2008 Lemur Consulting Ltd 00005 * Copyright 2008,2009 Olly Betts 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #ifndef XAPIAN_INCLUDED_TESTRUNNER_H 00024 #define XAPIAN_INCLUDED_TESTRUNNER_H 00025 00026 #include <string> 00027 00028 class BackendManager; 00029 00031 extern BackendManager * backendmanager; 00032 00036 class TestRunner { 00039 std::string user_backend; 00040 00045 int result_so_far; 00046 00049 std::string srcdir; 00050 00053 void set_properties(const std::string & properties); 00054 00057 bool use_backend(const std::string & backend_name); 00058 00061 void set_properties_for_backend(const std::string & backend_name); 00062 00065 void do_tests_for_backend(BackendManager * manager); 00066 00067 public: 00068 00070 bool backend; 00071 00073 bool remote; 00074 00076 bool transactions; 00077 00079 bool positional; 00080 00082 bool writable; 00083 00085 bool spelling; 00086 00088 bool synonyms; 00089 00091 bool metadata; 00092 00094 bool replicas; 00095 00097 bool valuestats; 00098 00100 bool generated; 00101 00103 bool multi; 00104 00106 bool inmemory; 00107 00109 bool brass; 00110 00112 bool chert; 00113 00115 bool flint; 00116 00118 virtual ~TestRunner(); 00119 00125 int run_tests(int argc, char ** argv); 00126 00132 virtual int run() const = 0; 00133 }; 00134 00135 #endif // XAPIAN_INCLUDED_TESTRUNNER_H