Commit 30ffb5a1 authored by Florent Jacquemard's avatar Florent Jacquemard
Browse files

equiv2: STUB for global fail (before debug)

parent a9e3bed5
......@@ -510,6 +510,27 @@ void setVerbosityLevel()
}
}
/// STUB for a parse fail at root (all bars)
size_t parse_fail(const std::string filename)
{
std::ofstream file;
file.open(filename, std::ios_base::out);
if(!file.is_open())
{
ERROR("LRT export : cannot open {} for writing", filename);
return 1;
}
file << "1. FAIL";
file.close();
return 0;
}
int main(int argc, char** argv)
{
// set for tracing the parsing of options
......@@ -722,7 +743,11 @@ int main(int argc, char** argv)
}
assert(t);
INFO("Ouput tree : {}", *t);
if (t != NULL)
{
INFO("Ouput tree : {}", *t);
}
if (f_output && (_output_file.size() == 0))
{
......@@ -734,9 +759,22 @@ int main(int argc, char** argv)
{
INFO("export trees to file {}", _output_file);
size_t err = t->write(_output_file);
size_t err = 0;
if (t == NULL)
{
err = parse_fail(_output_file);
}
else
{
err = t->write(_output_file);
}
if (err > 0)
ERROR("export failed");
{
ERROR("write error. failed to export to {}", _output_file);
}
}
return 0;
......
Supports Markdown
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