00001 //---------------------------------------------------------------------------- 00002 /** @file BenzeneTestMain.cpp 00003 */ 00004 //---------------------------------------------------------------------------- 00005 00006 #include "SgSystem.h" 00007 00008 #include "config.h" 00009 #include "HexProgram.hpp" 00010 #include "BenzeneTestEngine.hpp" 00011 #include "SwapCheck.hpp" 00012 00013 using namespace benzene; 00014 00015 //---------------------------------------------------------------------------- 00016 00017 /** @page benzenetestmainpage BenzeneTest 00018 00019 @section overview Overview 00020 00021 @todo Add more documentation about BenzeneTest! 00022 */ 00023 00024 //---------------------------------------------------------------------------- 00025 00026 namespace { 00027 00028 const char* build_date = __DATE__; 00029 00030 } 00031 00032 //---------------------------------------------------------------------------- 00033 00034 int main(int argc, char** argv) 00035 { 00036 HexProgram& program = HexProgram::Get(); 00037 program.SetInfo("BenzeneTest", VERSION, build_date); 00038 program.PrintStartupMessage(); 00039 program.Initialize(argc, argv); 00040 try 00041 { 00042 BenzeneTestEngine gh(program.BoardSize()); 00043 std::string config = program.ConfigFileToExecute(); 00044 if (config != "") 00045 gh.ExecuteFile(config); 00046 GtpInputStream gin(std::cin); 00047 GtpOutputStream gout(std::cout); 00048 gh.MainLoop(gin, gout); 00049 program.Shutdown(); 00050 } 00051 catch (const GtpFailure& f) 00052 { 00053 std::cerr << f.Response() << std::endl; 00054 return 1; 00055 } 00056 return 0; 00057 } 00058 00059 //----------------------------------------------------------------------------