Title: [271789] trunk/Tools
Revision
271789
Author
ab...@igalia.com
Date
2021-01-25 02:23:06 -0800 (Mon, 25 Jan 2021)

Log Message

[GTK] run-gtk-tests: Use sys.exit(1) instead of return 1
https://bugs.webkit.org/show_bug.cgi?id=220860

Reviewed by Philippe Normand.

Several parts of the code in api_test_runner.py returned 1 on failure.
While common for main() functions, this is bad in functions that are
expected to return something else than an exit code, and lets the
program run after the error. sys.exit(1) should be used in those cases
instead.

* glib/api_test_runner.py:
(TestRunner._get_tests_from_google_test_suite):
(TestRunner.run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (271788 => 271789)


--- trunk/Tools/ChangeLog	2021-01-25 09:45:47 UTC (rev 271788)
+++ trunk/Tools/ChangeLog	2021-01-25 10:23:06 UTC (rev 271789)
@@ -1,3 +1,20 @@
+2021-01-25  Alicia Boya GarcĂ­a  <ab...@igalia.com>
+
+        [GTK] run-gtk-tests: Use sys.exit(1) instead of return 1
+        https://bugs.webkit.org/show_bug.cgi?id=220860
+
+        Reviewed by Philippe Normand.
+
+        Several parts of the code in api_test_runner.py returned 1 on failure.
+        While common for main() functions, this is bad in functions that are
+        expected to return something else than an exit code, and lets the
+        program run after the error. sys.exit(1) should be used in those cases
+        instead.
+
+        * glib/api_test_runner.py:
+        (TestRunner._get_tests_from_google_test_suite):
+        (TestRunner.run_tests):
+
 2021-01-24  Simon Fraser  <simon.fra...@apple.com>
 
         [iOS WK2] theverge.com - rubber band scrolling at the top of the page causes an abrupt jump

Modified: trunk/Tools/glib/api_test_runner.py (271788 => 271789)


--- trunk/Tools/glib/api_test_runner.py	2021-01-25 09:45:47 UTC (rev 271788)
+++ trunk/Tools/glib/api_test_runner.py	2021-01-25 10:23:06 UTC (rev 271789)
@@ -203,7 +203,7 @@
         except subprocess.CalledProcessError:
             sys.stderr.write("ERROR: could not list available tests for binary %s.\n" % (test_program))
             sys.stderr.flush()
-            return 1
+            sys.exit(1)
 
         tests = []
         prefix = None
@@ -282,7 +282,7 @@
         if not self._tests:
             sys.stderr.write("ERROR: tests not found in %s.\n" % (self._test_programs_base_dir()))
             sys.stderr.flush()
-            return 1
+            sys.exit(1)
 
         self._setup_testing_environment()
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to