rambrain
performanceTests.cpp
Go to the documentation of this file.
1 /* rambrain - a dynamical physical memory extender
2  * Copyright (C) 2015 M. Imgrund, A. Arth
3  * mimgrund (at) mpifr-bonn.mpg.de
4  * arth (at) usm.uni-muenchen.de
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include <iostream>
21 #include <vector>
22 #include <cstring>
23 #include <cmath>
24 
25 #include "tester.h"
26 #include "performanceTestClasses.h"
27 
28 using namespace std;
29 
35 int main ( int argc, char **argv )
36 {
37  cout << "Starting performance tests" << endl;
38  cout << "Called with: ";
39  for ( int i = 0; i < argc; ++i ) {
40  cout << argv[i] << " ";
41  }
42  cout << endl << endl;
43 
44  int i = 1;
45  if ( i >= argc ) {
46  cerr << "Not enough arguments supplied, expected number of repetitions followed by test directives, exiting" << endl;
47  return 2;
48  }
49 
50  int repetitions = atoi ( argv[i++] );
51 
52  while ( i < argc ) {
53  cout << "Attempting to run " << argv[i] << endl;
54  tester myTester ( argv[i] );
55  int j;
56  for ( j = i + 1; j < argc; ++j ) {
57  myTester.addParameter ( argv[j] );
58  }
59 
60  ++i;
61  bool success = performanceTest<>::runRespectiveTest ( argv[i - 1], myTester, repetitions, argv, i, argc );
62 
63  if ( success ) {
64  myTester.writeToFile();
65  }
66  }
67 
68  cout << "Performance tests done" << endl;
69  return 0;
70 }
71 
Derived performance test classes which take parameter types as template arguments.
A basic class to be used by tests. Provides helper methods and functionality e.g. time measurements...
Definition: tester.h:32
void writeToFile()
Write all collected information to file.
Definition: tester.cpp:100
STL namespace.
void addParameter(char *param)
Add a new parameter to the list of parameters.
Definition: tester.cpp:31
int main(int argc, char **argv)
Provides a binary to run performance tests.