-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathLatMain.cc
49 lines (41 loc) · 1.25 KB
/
LatMain.cc
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
#include <sys/types.h>
#include <sys/stat.h>
#include <iostream>
#include "latmrg/LatTestAll.h"
using namespace std;
using namespace LatMRG;
//==========================================================================
int main (int argc, char **argv)
{
/*
if (argc < 2) {
cerr << "\n*** Usage:\n "
<< argv[0] << " data_file1 data_file2 ...." << endl
<< "or\n "
<< argv[0] << " dir1 dir2 ...." << endl
<< endl;
return -1;
}
*/
struct stat buf; // properties of a file or directory
LatTestAll testall;
int status = 0;
char *testfile = "/Users/Erwan1/projects/github/LatMRG/latZZDD_test2";
status |= testall.doTest (testfile);
for (int j = 1; j < argc; j++) {
// Do the test for each data file or directory on the command line
stat(argv[j], &buf);
if (0 != S_ISDIR(buf.st_mode)) // directory
status |= testall.doTestDir (argv[j]);
else {
string dataname(argv[j]);
dataname.append(".dat");
stat(dataname.c_str(), &buf);
if (0 != S_ISREG(buf.st_mode)){ // data file
//status |= testall.doTest (argv[j]);
status |= testall.doTest (testfile);
}
}
}
return status;
}