File: aotest.cpp

package info (click to toggle)
aoflagger 2.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,232 kB
  • sloc: cpp: 61,805; python: 60; sh: 23; makefile: 8
file content (64 lines) | stat: -rw-r--r-- 1,650 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>

#include "test/strategy/algorithms/algorithmstestgroup.h"
#include "test/experiments/experimentstestgroup.h"
#include "test/msio/msiotestgroup.h"
#include "test/quality/qualitytestgroup.h"
#include "test/structures/structurestestgroup.h"
#include "test/util/utiltestgroup.h"
#include "test/msio/msiotestgroup.h"

int main(int argc, char *argv[])
{
  unsigned successes = 0, failures = 0;
	if(argc == 2 && std::string(argv[1])=="time")
	{
		ExperimentsTestGroup group;
		group.Run();
		successes += group.Successes();
		failures += group.Failures();
	}
	
	else if(argc == 1 || std::string(argv[1])!="only")
	{
		AlgorithmsTestGroup mainGroup;
		mainGroup.Run();
		successes += mainGroup.Successes();
		failures += mainGroup.Failures();

		MSIOTestGroup msioGroup;
		msioGroup.Run();
		successes += msioGroup.Successes();
		failures += msioGroup.Failures();
		
		QualityTestGroup qualityGroup;
		qualityGroup.Run();
		successes += qualityGroup.Successes();
		failures += qualityGroup.Failures();
		
		UtilTestGroup utilGroup;
		utilGroup.Run();
		successes += utilGroup.Successes();
		failures += utilGroup.Failures();
		
		StructuresTestGroup structGroup;
		structGroup.Run();
		successes += structGroup.Successes();
		failures += structGroup.Failures();
	}
	
	if(argc > 1 && (std::string(argv[1])=="all" || std::string(argv[1])=="only"))
	{
		ExperimentsTestGroup resultsGroup;
		resultsGroup.Run();
		successes += resultsGroup.Successes();
		failures += resultsGroup.Failures();
	}
	
	std::cout << "Succesful tests: " << successes << " / " << (successes + failures) << '\n';
	
	if(failures == 0)
		return 0;
	else
		return 1;
}