mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
Switched from loading test files to testing specific parsing constructs. The tests don't fully cover the span (eventually I'll add more, maybe), but there's a bunch there.
More to the point, the yaml-reader program doesn't do any file IO, so it doesn't require a specific working directory.
This commit is contained in:
@@ -1,38 +1,11 @@
|
||||
#include "yaml.h"
|
||||
#include "tests.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
void run()
|
||||
{
|
||||
std::ifstream fin("tests/test.yaml");
|
||||
YAML::Parser parser(fin);
|
||||
|
||||
while(parser)
|
||||
{
|
||||
YAML::Node doc;
|
||||
parser.GetNextDocument(doc);
|
||||
std::cout << doc;
|
||||
}
|
||||
|
||||
// try some output
|
||||
YAML::Emitter out;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bool verbose = false;
|
||||
for(int i=1;i<argc;i++) {
|
||||
if(std::strcmp(argv[i], "-v") == 0)
|
||||
verbose = true;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS
|
||||
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
||||
#endif // WINDOWS
|
||||
Test::RunAll(verbose);
|
||||
run();
|
||||
Test::RunAll();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user