Commit cee0974a authored by jbeder's avatar jbeder
Browse files

Refactored parse.cpp so that VS doesn't complain, added MinSizeRel build...

Refactored parse.cpp so that VS doesn't complain, added MinSizeRel build setting, and fixed numbering in the spec tests
parent 5b1ca743
......@@ -113,6 +113,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
#
set(GCC_EXTRA_OPTIONS "")
#
......
......@@ -2155,8 +2155,8 @@ namespace Test {
RunSpecTest(&Spec::BlockIndentationHeader, "8.2", "Block Indentation Header", passed, total);
RunSpecTest(&Spec::InvalidBlockScalarIndentationIndicators, "8.3", "Invalid Block Scalar Indentation Indicators", passed, total);
RunSpecTest(&Spec::ChompingFinalLineBreak, "8.4", "Chomping Final Line Break", passed, total);
RunSpecTest(&Spec::ChompingTrailingLines, "8.4", "Chomping Trailing Lines", passed, total);
RunSpecTest(&Spec::EmptyScalarChomping, "8.4", "Empty Scalar Chomping", passed, total);
RunSpecTest(&Spec::ChompingTrailingLines, "8.5", "Chomping Trailing Lines", passed, total);
RunSpecTest(&Spec::EmptyScalarChomping, "8.6", "Empty Scalar Chomping", passed, total);
std::cout << "Spec tests: " << passed << "/" << total << " passed\n";
return passed == total;
......
......@@ -34,15 +34,8 @@ public:
virtual void OnMapEnd() {}
};
int main(int argc, char **argv)
void parse(std::istream& input)
{
Params p = ParseArgs(argc, argv);
std::ifstream fin;
if(argc > 1)
fin.open(argv[1]);
std::istream& input = (argc > 1 ? fin : std::cin);
try {
YAML::Parser parser(input);
YAML::Node doc;
......@@ -55,5 +48,19 @@ int main(int argc, char **argv)
} catch(const YAML::Exception& e) {
std::cerr << e.what() << "\n";
}
}
int main(int argc, char **argv)
{
Params p = ParseArgs(argc, argv);
if(argc > 1) {
std::ifstream fin;
fin.open(argv[1]);
parse(fin);
} else {
parse(std::cin);
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment