]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
modify cli-test logic : ignore stderr message by default
authorYann Collet <cyan@fb.com>
Thu, 26 Jan 2023 00:29:34 +0000 (16:29 -0800)
committerYann Collet <cyan@fb.com>
Thu, 26 Jan 2023 18:57:41 +0000 (10:57 -0800)
Previously, cli-test would, by default, check that a stderr output is strictly identical to a saved outcome.
When there was no instructions on how to interpret stderr, it would default to requiring it to be empty.

There are many tests cases though where stderr content doesn't matter, and we are mainly interested in the return code of the cli.
For these cases, it was possible to set a .ignore document, which would instruct to ignore stderr content.

This PR update the logic, to make .ignore the default.
When willing to check that stderr content is empty, one must now add an empty .strict file.

This will allow status message to evolve without triggering many cli-tests errors.
This is especially important when some of these status include compression results, which may change as a result of compression optimizations.
It also makes it easier to add new tests which only care about the CLI's return code.

tests/cli-tests/run.py

index 8b4e21a53eca9c62da91c3370968c952264ba066..45af5124b31f9cd7efd3c335dea323e233ea022a 100755 (executable)
@@ -395,12 +395,10 @@ class TestCase:
             return self._check_output_exact(out_name, read_file(exact_name), exact_name)
         elif os.path.exists(glob_name):
             return self._check_output_glob(out_name, read_file(glob_name))
-        elif os.path.exists(ignore_name):
+        else:
             check_name = f"check_{out_name}"
             self._success[check_name] = True
             self._message[check_name] = f"{out_name} ignored!"
-        else:
-            return self._check_output_exact(out_name, bytes(), exact_name)
 
     def _check_stderr(self) -> None:
         """Checks the stderr output against the expectation."""
@@ -738,4 +736,3 @@ if __name__ == "__main__":
         sys.exit(0)
     else:
         sys.exit(1)
-