GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/OptionParser/TESTS/TEST_ParserOptionListString/main.cpp Lines: 16 16 100.0 %
Date: 2024-12-09 15:30:52 Branches: 23 23 100.0 %

Line Branch Exec Source
1
2
/***************************************
3
	Auteur : Pierre Aubert
4
	Mail : pierre.aubert@lapp.in2p3.fr
5
	Licence : CeCILL-C
6
****************************************/
7
8
#include "phoenix_assert.h"
9
#include "phoenix_check.h"
10
#include "OptionParser.h"
11
12
///Create the OptionParser of this program
13
/**	@return OptionParser of this program
14
*/
15
1
OptionParser createOptionParser(){
16
2
	OptionParser parser(true, "1.0.0");
17

1
	parser.addOption("input", "i", OptionType::FILENAME, true, "Required option");
18
1
	return parser;
19
}
20
21
1
int main(int argc, char** argv){
22
2
	OptionParser parser = createOptionParser();
23
1
	parser.parseArgument(argc, argv);
24
25
1
	const OptionMode & defaultMode = parser.getDefaultMode();
26
2
	std::list<std::string> listInputFile;
27
1
	defaultMode.getValue(listInputFile, "input");
28
// 	std::cout << "input = {" << std::endl;
29
// 	for(std::list<std::string>::iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
30
// 		std::cout << "\t'" << *it << "'" << std::endl;
31
// 	}
32
// 	std::cout << "}" << std::endl;
33
1
	std::list<std::string> listReference;
34
1
	listReference.push_back("fileName1.txt");
35
1
	listReference.push_back("fileName2.txt");
36
1
	listReference.push_back("fileName3.txt");
37

1
	phoenix_assert(phoenix_check("Check list input", listInputFile, listReference));
38
1
	return 0;
39
}
40
41