20 #include <sys/types.h>
37 int main (
int argc,
char **argv )
39 cout <<
"Wrapper for performance tests called" << endl;
42 unsigned int repetitions = 10;
44 if ( ! strcmp ( argv[1],
"help" ) || ! strcmp ( argv[1],
"list" ) ) {
48 repetitions = atoi ( argv[1] );
55 if ( ! strcmp ( argv[i],
"true" ) ) {
57 cout <<
"Setting display plots to true" << endl;
59 }
else if ( ! strcmp ( argv[i],
"false" ) ) {
60 cout <<
"Setting display plots to false" << endl;
66 if ( ! strcmp ( argv[i],
"+" ) ) {
70 }
else if ( ! strcmp ( argv[i],
"-" ) ) {
75 cerr << argv[i] <<
" not supported as " << i <<
" parameter, expected true/false or +/-" << endl;
79 for ( ; i < argc; ++i ) {
87 ret = readlink (
"/proc/self/exe", exe,
sizeof ( exe ) - 1 );
93 for (
auto it = file.crbegin(); it != file.crend(); it++, n++ ) {
94 if ( ( *it ) ==
'/' ) {
98 string path = file.substr ( 0, file.length() - n );
99 int success = chdir ( path.c_str() );
101 cout <<
"Changed working directory to " << path << endl;
103 cerr <<
"Could not chdir to " << path <<
". Aborting." << endl;
107 cerr <<
"Could not read executable path, aborting" << endl;
112 struct stat st = {0};
113 if ( stat (
"performancetests", &st ) == -1 ) {
114 int success = mkdir (
"performancetests", 0777 );
116 cout <<
"Created performancetests subdirectory for outputs" << endl;
118 cerr <<
"Could not create subdirectory performancetests, aborting." << endl;
124 int success = chdir (
"performancetests" );
126 cout <<
"Changed working directory to subdirectory performancetests" << endl;
128 cerr <<
"Could not chdir to subdirectory performancetests. Aborting." << endl;
141 cout << endl << endl <<
"All tests done, exiting..." << endl;
Derived performance test classes which take parameter types as template arguments.
int main(int argc, char **argv)
Provides a wrapper binary to run performance tests and scan through respective parameter spaces...