summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2019-07-18 14:24:20 +0200
committerFlorian Bruhin <me@the-compiler.org>2019-07-18 15:41:54 +0200
commit80f7dd7236285ba75f91380ffdb6f39c4cf54f39 (patch)
tree72ac00ae06aefd1bac65fa6f10b58fb217720569
parent6dce8779e9bc8eecb793d556f46a95fdee0e931b (diff)
downloadqutebrowser-80f7dd7236285ba75f91380ffdb6f39c4cf54f39.tar.gz
qutebrowser-80f7dd7236285ba75f91380ffdb6f39c4cf54f39.zip
Check stdout/stderr of processes when running smoke test
(cherry picked from commit 730018e37e19878681b1ae7c92afb38cd02e7c96)
-rwxr-xr-xscripts/dev/build_release.py31
1 files changed, 28 insertions, 3 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py
index aa1026c0a..ac06b8b6c 100755
--- a/scripts/dev/build_release.py
+++ b/scripts/dev/build_release.py
@@ -32,6 +32,7 @@ import argparse
import tarfile
import tempfile
import collections
+import re
try:
import winreg
@@ -92,11 +93,35 @@ def _maybe_remove(path):
pass
+def _filter_whitelisted(output, patterns):
+ for line in output.decode('utf-8').splitlines():
+ if not any(re.fullmatch(pattern, line) for pattern in patterns):
+ yield line
+
+
def smoke_test(executable):
"""Try starting the given qutebrowser executable."""
- subprocess.run([executable, '--no-err-windows', '--nowindow',
- '--temp-basedir', 'about:blank', ':later 500 quit'],
- check=True)
+ stdout_whitelist = []
+ stderr_whitelist = [
+ # PyInstaller debug output
+ r'\[.*\] PyInstaller Bootloader .*',
+ r'\[.*\] LOADER: .*',
+
+ # https://github.com/qutebrowser/qutebrowser/issues/4919
+ r'objc\[.*\]: .* One of the two will be used\. Which one is undefined\.',
+ (r'QCoreApplication::applicationDirPath: Please instantiate the '
+ r'QApplication object first'),
+ ]
+
+ proc = subprocess.run([executable, '--no-err-windows', '--nowindow',
+ '--temp-basedir', 'about:blank',
+ ':later 500 quit'], check=True, capture_output=True)
+ stdout = '\n'.join(_filter_whitelisted(proc.stdout, stdout_whitelist))
+ stderr = '\n'.join(_filter_whitelisted(proc.stderr, stderr_whitelist))
+ if stdout:
+ raise Exception("Unexpected stdout:\n{}".format(stdout))
+ if stderr:
+ raise Exception("Unexpected stderr:\n{}".format(stderr))
def patch_mac_app():