"...composable_kernel.git" did not exist on "6dfb4e7851a99eab605d239873b7eca777980fa8"
Commit 943d000a authored by Jesse Beder's avatar Jesse Beder
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 cb632b39
...@@ -113,6 +113,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) ...@@ -113,6 +113,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
# #
set(GCC_EXTRA_OPTIONS "") set(GCC_EXTRA_OPTIONS "")
# #
......
...@@ -2155,8 +2155,8 @@ namespace Test { ...@@ -2155,8 +2155,8 @@ namespace Test {
RunSpecTest(&Spec::BlockIndentationHeader, "8.2", "Block Indentation Header", passed, total); RunSpecTest(&Spec::BlockIndentationHeader, "8.2", "Block Indentation Header", passed, total);
RunSpecTest(&Spec::InvalidBlockScalarIndentationIndicators, "8.3", "Invalid Block Scalar Indentation Indicators", 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::ChompingFinalLineBreak, "8.4", "Chomping Final Line Break", passed, total);
RunSpecTest(&Spec::ChompingTrailingLines, "8.4", "Chomping Trailing Lines", passed, total); RunSpecTest(&Spec::ChompingTrailingLines, "8.5", "Chomping Trailing Lines", passed, total);
RunSpecTest(&Spec::EmptyScalarChomping, "8.4", "Empty Scalar Chomping", passed, total); RunSpecTest(&Spec::EmptyScalarChomping, "8.6", "Empty Scalar Chomping", passed, total);
std::cout << "Spec tests: " << passed << "/" << total << " passed\n"; std::cout << "Spec tests: " << passed << "/" << total << " passed\n";
return passed == total; return passed == total;
......
...@@ -34,15 +34,8 @@ public: ...@@ -34,15 +34,8 @@ public:
virtual void OnMapEnd() {} 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 { try {
YAML::Parser parser(input); YAML::Parser parser(input);
YAML::Node doc; YAML::Node doc;
...@@ -55,5 +48,19 @@ int main(int argc, char **argv) ...@@ -55,5 +48,19 @@ int main(int argc, char **argv)
} catch(const YAML::Exception& e) { } catch(const YAML::Exception& e) {
std::cerr << e.what() << "\n"; 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; 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