main.cpp 642 Bytes
Newer Older
1
2
3
4
#include "yaml.h"
#include "tests.h"
#include <fstream>
#include <iostream>
jbeder's avatar
jbeder committed
5
#include <cstring>
6

7
8
9
#include "emitter.h"
#include "stlemitter.h"

10
11
12
void run()
{
	std::ifstream fin("tests/test.yaml");
13
	YAML::Parser parser(fin);
14

15
16
	while(parser)
	{
17
18
		YAML::Node doc;
		parser.GetNextDocument(doc);
19
		std::cout << doc;
20
	}
21
22
23
	
	// try some output
	YAML::Emitter out;
24
25
26
27
28
29
}

int main(int argc, char **argv)
{
	bool verbose = false;
	for(int i=1;i<argc;i++) {
jbeder's avatar
jbeder committed
30
		if(std::strcmp(argv[i], "-v") == 0)
31
32
33
34
35
36
37
38
39
40
41
			verbose = true;
	}

#ifdef WINDOWS
	_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
#endif // WINDOWS
	Test::RunAll(verbose);
	run();

	return 0;
}