diff options
author | Christian Tismer <tismer@stackless.com> | 2019-11-01 11:38:42 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2019-11-07 09:06:37 +0100 |
commit | 107eb625c28bba7234221aa0fd71b84dd09361e2 (patch) | |
tree | 726c3c63a9a9e52e200cf7ae0d798e845fe76459 /sources/pyside2/tests | |
parent | 8dd42e79505bfb5477fafbe12056e2dd3c7f07b9 (diff) |
Simplify recreation of registry files
The registry files were recreated when they do not exist. This was used
to trigger recreation on a file.
We now include a comment line on top of the files.
#recreate # uncomment this to enforce generation
By uncommenting this line, a NameError is provoked, which has the
desired effect without creating huge deltas in the repository.
Change-Id: Idcc1015abae504f111102e8c9851f8ef45dcbdff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r-- | sources/pyside2/tests/registry/existence_test.py | 7 | ||||
-rw-r--r-- | sources/pyside2/tests/registry/init_platform.py | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py index 0313bd9f8..6db88a818 100644 --- a/sources/pyside2/tests/registry/existence_test.py +++ b/sources/pyside2/tests/registry/existence_test.py @@ -100,6 +100,13 @@ except SyntaxError: print("*** not a python file, removed:", shortpath) os.unlink(effectiveRefPath) have_refmodule = False +except NameError as e: + if "recreate" in e.args[0]: + print("*** explicit request to recreate:", shortpath) + else: + print("*** unexpected NameError:", e, "- creating", shortpath) + os.unlink(effectiveRefPath) + have_refmodule = False dict_name = "sig_dict" if have_refmodule and not hasattr(sig_exists, dict_name): print("*** wrong module without '{dict_name}', removed:" diff --git a/sources/pyside2/tests/registry/init_platform.py b/sources/pyside2/tests/registry/init_platform.py index 61964a3c1..a690a3120 100644 --- a/sources/pyside2/tests/registry/init_platform.py +++ b/sources/pyside2/tests/registry/init_platform.py @@ -219,6 +219,7 @@ def generate_all(): lines = f.readlines() license_line = next((lno for lno, line in enumerate(lines) if "$QT_END_LICENSE$" in line)) + fmt.print("#recreate # uncomment this to enforce generation") fmt.print("".join(lines[:license_line + 3])) version = sys.version.replace('\n', ' ') build = qt_build() |