diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-03-23 17:22:58 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-03-25 21:55:51 +0100 |
commit | a8a7f6c4e63d5f03675937431b736962aa8941df (patch) | |
tree | 0dd5956189789f953daa1bae5cee969e4c717c4a /tests/auto/testlib/selftests | |
parent | 1f0063cd8df9a3c75715ceab13432e542dc65688 (diff) |
Fix parsing of .cmake.conf in generate_expected_output.py
It relied on the set(QT_REPO_MODULE_VERSION ...) line being the first
thing in the file. It no longer is, and the variable is referenced in
an earlier condition.
Change-Id: I2bd2abd2a5680782ddd61f4bf4a4a3265b444d52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests')
-rwxr-xr-x | tests/auto/testlib/selftests/generate_expected_output.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 0dc6748f08..f3fd1509dd 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ############################################################################# ## -## Copyright (C) 2020 The Qt Company Ltd. +## Copyright (C) 2022 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the release tools of the Qt Toolkit. @@ -99,8 +99,12 @@ class Cleaner (object): def _read_qt_version(qtbase_dir): cmake_conf_file = os.path.join(qtbase_dir, '.cmake.conf') with open(cmake_conf_file) as f: - qtver = f.readline().strip() - return qtver.split('"')[1] # set(QT_REPO_MODULE_VERSION "6.1.0") + for line in f: + # set(QT_REPO_MODULE_VERSION "6.1.0") + if 'set(QT_REPO_MODULE_VERSION' in line: + return line.strip().split('"')[1] + + raise RuntimeError("Someone broke .cmake.conf formatting again") @staticmethod def __getPatterns(patterns = ( |