7 #ifndef MANAK_HPP_INCLUDED
8 #define MANAK_HPP_INCLUDED
39 #ifdef MANAK_CONFIG_FILE
40 #include MANAK_CONFIG_FILE
41 #endif // MANAK_CONFIG_FILE
46 #ifdef MANAK_MANUAL_INIT_FUNCTION
47 MANAK_MANUAL_INIT_FUNCTION();
48 #endif // MANAK_MANUAL_INIT_FUNCTION
62 inline int manak_main(
int argc,
char* argv[] )
64 bool output_format_html =
true;
69 std::cout <<
"-h : For help" << std::endl;
70 std::cout <<
"-r regex : Only the cases satisfying the given regex will run." << std::endl;
71 std::cout <<
" Check out guide for supported regex expressions." << std::endl;
72 std::cout <<
"-o filename : Save output to given file." << std::endl;
73 std::cout <<
"-s filename : Save the result for comparison." << std::endl;
74 std::cout <<
"-c filename : Load the given file for comparison." << std::endl;
75 std::cout <<
"-f HTML : Save the output as HTML(Default)" << std::endl;
76 std::cout <<
" TXT : Save the output as text document" << std::endl;
86 std::string pattern =
"";
94 pattern = std::string(c_pattern);
98 std::cout <<
"No pattern given!" << std::endl;
106 if(format ==
"TXT" || format ==
"txt")
107 output_format_html =
false;
108 else if(format ==
"HTML" || format ==
"html");
111 std::cerr <<
"Unrecognized format \"" << format <<
"\"" << std::endl;
112 std::cerr <<
"For supported formats pass \"-h\"" << std::endl;
117 std::string filename;
127 if(output_format_html)
137 if(output_format_html)
159 std::ifstream com_file(filename);
170 std::ofstream ss(filename);
186 #ifdef MANAK_AUTO_MAIN
188 int main(
int argc,
char* argv[])
190 return manak::manak_main(argc, argv);
193 #endif // MANAK_AUTO_MAIN
195 #endif // MANAK_HPP_INCLUDED
static char * getCmdOption(char **begin, char **end, const std::string &option)
Check if certain option is passed.
MANAK_INLINE void Print()
static ManakSuite & GetMasterSuite()
const std::string & GetModuleName() const
static ManakEnv & GlobalEnv()
#define MANAK_MODULE_NAME
Set the module name for further use.
#define MANAK_DEFAULT_OUT_FILENAME
If no output file is given benchmarking statistics will be saved to this file.
MANAK_INLINE void LoadForComparison(std::istream &stream)
MANAK_INLINE bool Run(const std::string &uname="", const std::string &pattern="", const bool compare=false)
const std::string & Name() const
static ResultCollector & GlobalResultCollector()
std::string GetVersionInfo()
Returns the version information in string.
#define MANAK_STRINGIZE(X)
Converts the parameter into string.
static OutputManager & GlobalOutputManager()
static bool cmdOptionExists(char **begin, char **end, const std::string &option)
Get passed option.
MANAK_INLINE void SaveForComparison(std::ostream &stream)
MANAK_INLINE void AddHandler(OutputHandler *handler)