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:
Jesse Beder
2009-05-31 06:36:01 +00:00
parent 9585797b41
commit 1cde7fbfc0
11 changed files with 890 additions and 766 deletions

View File

@@ -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;
}