-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
66 lines (59 loc) · 1.44 KB
/
main.c
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
65
66
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "Wahlaan/Rii.h"
#include "Test/Tests.h"
static void
printHelp()
{
printf("Incorrect arguments. \n"
"Usage:\n"
" --suite <<SUITE>> (required)\n"
" options: SANITY, PERFORMANCE, COLOR, BIPARTITO, CUSTOM\n\n"
" --file <<FILENAME>> (optional)\n");
}
static void
testGrafo(enum Suite suite) {
// correr tests
printf("\n\n");
switch (suite) {
case SANITY:
SanitySuite();
break;
case PERFORMANCE:
PerformanceSuite();
break;
case COLOR:
ColorSuite();
break;
case BIPARTITO:
BipartitoSuite();
break;
case CUSTOM:
CustomSuite();
break;
case NONE:
printHelp();
break;
}
}
int
main(int argv, char** argc)
{
// tomamos el argumento suite (requerido)
if (argv < 3 || strcmp(argc[1], "--suite") != 0) {
// incorrect arguments
printHelp();
return 0;
}
// tomamos el argumento file (opcional)
// y pasamos su contenido como stdin
//if (argv >= 5 && strcmp(argc[3], "--file") == 0) {
// char * file_name = argc[4];
// freopen(file_name, "r", stdin);
//}
// tomamos la suite y testeamos
enum Suite suite = SuiteFromString(argc[2]);
testGrafo(suite);
return 0;
}