Files Classes Functions Hierarchy
00001 00002 #include <commandline.h> 00003 #include <modulereport.h> 00004 #include <mkerrors.h> 00005 #include <mkerrorsconfig.h> 00006 #include <mkerrorstest.h> 00007 #include <projunittest.h> 00008 #include <projunittests.h> 00009 00010 string mkerrorstest::doc[] = 00011 { 00012 "Compile : mkerrors", 00013 "Unit test : projunittest", 00014 "Unit tests : projunittests", 00015 "Basic html module status page test.", 00016 "Full html module status page.", 00017 "Unit test : mkerrorsconfig", 00018 "Complie : mkerrors with config", 00019 "" 00020 }; 00021 00022 int mkerrorstest::test01 00023 ( 00024 int argc, char** argv 00025 ) 00026 { 00027 return mkerrorscompile().eval(argc,argv); 00028 } 00029 00030 int mkerrorstest::test06 00031 ( 00032 int argc, char** argv 00033 ) 00034 { 00035 return mkerrorscompile().eval2(argc,argv); 00036 } 00037 00038 int mkerrorstest::test02 00039 ( 00040 int argc, char** argv 00041 ) 00042 { 00043 commandline cmd(argc,argv); 00044 00045 string filename=cmd.args[1]; 00046 00047 projunittest unit(filename); 00048 if (cmd.hastoken("silent")) 00049 unit.terminal.setsilent(); 00050 if (cmd.hastoken("summary")) 00051 unit.terminal.setsummary(); 00052 00053 return unit.eval(); 00054 } 00055 00056 int mkerrorstest::test03 00057 ( 00058 int argc, char** argv 00059 ) 00060 { 00061 commandline cmd(argc,argv); 00062 00063 projunittests units; 00064 if (cmd.hastoken("silent")) 00065 units.terminal.setsilent(); 00066 if (cmd.hastoken("summary")) 00067 units.terminal.setsummary(); 00068 00069 return units.eval(); 00070 } 00071 00072 00073 int mkerrorstest::test04 00074 ( 00075 int argc, char** argv 00076 ) 00077 { 00078 // commandline cmd(argc,argv); 00079 00080 modulereport mrep; 00081 mrep.update01(); 00082 00083 return 0; 00084 } 00085 00086 int mkerrorstest::test05 00087 ( 00088 int argc, char** argv 00089 ) 00090 { 00091 modulereport mrep; 00092 mrep.update(); 00093 00094 return 0; 00095 } 00096 00097 00098 int mkerrorstest::unittest01 00099 ( 00100 int argc, char** argv 00101 ) 00102 { 00103 cout << "Testing reading config" << endl; 00104 00105 mkerrorsconfig mkc; 00106 00107 cout << SHOW3(mkerrorsconfig::globalconfigfile) << endl; 00108 cout << SHOW3(mkc.globalconfigfile_exists) << endl; 00109 cout << SHOW3(mkc.vi.size()) << endl; 00110 00111 cout << "Reading global configuration file: " << SHOW3(mkerrorsconfig::globalconfigfile) << endl; 00112 mkc.read(); 00113 00114 cout << "Printing list" << endl; 00115 00116 cout << SHOW3(mkc.vi.size()) << endl; 00117 for (uint i=0; i<mkc.vi.size(); ++i) 00118 { 00119 cout << mkc.vi[i].xml() << endl; 00120 } 00121 00122 cout << SHOW3(mkc.globalconfigfile_exists) << endl; 00123 00124 cout << "Try a find: debug, release, gproj and gdb" << endl; 00125 mkerrorscompiletag ct; 00126 assertreturnOS(mkc.find(ct,"debug")); 00127 assertreturnOS(mkc.find(ct,"release")); 00128 assertreturnOS(mkc.find(ct,"gprof")); 00129 assertreturnOS(mkc.find(ct,"gdb")); 00130 00131 return 0; 00132 } 00133
1.5.8