Commit b742c771 authored by Bjorn Munch's avatar Bjorn Munch

Bug #44012 mtr: test cases that are not supposed to return output always fail

Output would match an empty result file but we don't check
Allow empty output IFF there is an empty result file.
parent 1d99f9ea
...@@ -7987,6 +7987,8 @@ int main(int argc, char **argv) ...@@ -7987,6 +7987,8 @@ int main(int argc, char **argv)
if (parsing_disabled) if (parsing_disabled)
die("Test ended with parsing disabled"); die("Test ended with parsing disabled");
my_bool empty_result= FALSE;
/* /*
The whole test has been executed _sucessfully_. The whole test has been executed _sucessfully_.
Time to compare result or save it to record file. Time to compare result or save it to record file.
...@@ -8027,11 +8029,20 @@ int main(int argc, char **argv) ...@@ -8027,11 +8029,20 @@ int main(int argc, char **argv)
} }
else else
{ {
die("The test didn't produce any output"); /* Empty output is an error *unless* we also have an empty result file */
if (! result_file_name || record ||
compare_files (log_file.file_name(), result_file_name))
{
die("The test didn't produce any output");
}
else
{
empty_result= TRUE; /* Meaning empty was expected */
}
} }
if (!command_executed && result_file_name) if (!command_executed && result_file_name && !empty_result)
die("No queries executed but result file found!"); die("No queries executed but non-empty result file found!");
verbose_msg("Test has succeeded!"); verbose_msg("Test has succeeded!");
timer_output(); timer_output();
......
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