Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
libcxx_check.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
# Copyright 2022 The PDFium Authors
3
# Use of this source code is governed by a BSD-style license that can be
4
# found in the LICENSE file.
5
"""Verifies libcxx_revision entries are in sync.
6
7
DEPS and buildtools/deps_revisions.gni both have libcxx_revision entries.
8
Check that they are in sync.
9
"""
10
11
import
re
12
import
sys
13
14
15
def
_ExtractRevisionFromFile
(path, regex):
16
"""Gets the revision by reading path and searching the lines using regex."""
17
data =
open
(path,
'rb'
).
read
().splitlines()
18
revision =
None
19
for
line
in
data:
20
match = regex.match(line)
21
if
not
match:
22
continue
23
if
revision:
24
return
None
25
revision = match.group(1)
26
return
revision
27
28
29
def
_GetDepsLibcxxRevision
(deps_path):
30
"""Gets the libcxx_revision from DEPS."""
31
regex = re.compile(b
"^ 'libcxx_revision': '(.*)',$"
)
32
return
_ExtractRevisionFromFile
(deps_path, regex)
33
34
35
def
_GetBuildtoolsLibcxxRevision
(buildtools_deps_path):
36
"""Gets the libcxx_revision from buildtools/deps_revisions.gni."""
37
regex = re.compile(b
'^ libcxx_revision = "(.*)"$'
)
38
return
_ExtractRevisionFromFile
(buildtools_deps_path, regex)
39
40
41
def
main
():
42
if
len(sys.argv) != 3:
43
print
(
'Wrong number of arguments'
)
44
return
0
45
46
deps_path = sys.argv[1]
47
deps_revision =
_GetDepsLibcxxRevision
(deps_path)
48
if
not
deps_revision:
49
print
(
'Cannot parse'
, deps_path)
50
return
0
51
52
buildtools_deps_path = sys.argv[2]
53
buildtools_revision =
_GetBuildtoolsLibcxxRevision
(buildtools_deps_path)
54
if
not
buildtools_revision:
55
print
(
'Cannot parse'
, buildtools_deps_path)
56
return
0
57
58
if
deps_revision != buildtools_revision:
59
print
(
'libcxx_revision mismatch between %s and %s: %s vs. %s'
%
60
(deps_path, buildtools_deps_path, deps_revision, buildtools_revision))
61
return
0
62
63
64
if
__name__ ==
'__main__'
:
65
sys.exit(
main
())
testing.tools.libcxx_check.main
main()
Definition
libcxx_check.py:41
testing.tools.libcxx_check._GetBuildtoolsLibcxxRevision
_GetBuildtoolsLibcxxRevision(buildtools_deps_path)
Definition
libcxx_check.py:35
testing.tools.libcxx_check._GetDepsLibcxxRevision
_GetDepsLibcxxRevision(deps_path)
Definition
libcxx_check.py:29
testing.tools.libcxx_check._ExtractRevisionFromFile
_ExtractRevisionFromFile(path, regex)
Definition
libcxx_check.py:15
print
QDebug print(QDebug debug, QSslError::SslError error)
Definition
qsslerror.cpp:350
read
ReturnedValue read(const char *data)
Definition
qv4typedarray.cpp:101
open
file open(QIODevice::ReadOnly)
qtwebengine
src
3rdparty
chromium
third_party
pdfium
testing
tools
libcxx_check.py
Generated on Thu Nov 14 2024 01:10:18 for Qt by
1.12.0