Update tests to use list-qt/list-tool syntax

This commit is contained in:
David Dalcino
2021-07-20 13:32:23 -07:00
parent 9f4b90966a
commit c3d202730c
12 changed files with 175 additions and 244 deletions

View File

@@ -28,6 +28,7 @@ class BuildJob:
subarchives=None, subarchives=None,
output_dir=None, output_dir=None,
list_options=None, list_options=None,
spec=None,
): ):
self.command = command self.command = command
self.qt_version = qt_version self.qt_version = qt_version
@@ -39,6 +40,8 @@ class BuildJob:
self.mirror = mirror self.mirror = mirror
self.subarchives = subarchives self.subarchives = subarchives
self.list_options = list_options if list_options else {} self.list_options = list_options if list_options else {}
# `steps.yml` assumes that qt_version is the highest version that satisfies spec
self.spec = spec
self.output_dir = output_dir self.output_dir = output_dir
@@ -161,17 +164,16 @@ linux_build_jobs.extend(
"doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qtdoc" "doc", "6.1.0", "linux", "desktop", "gcc_64", "gcc_64", subarchives="qtdoc"
), ),
# test for list commands # test for list commands
BuildJob('list', '5.15.2', 'linux', 'desktop', '', '', list_options={ BuildJob('list', '5.15.2', 'linux', 'desktop', '', '', spec="<6", list_options={
'HAS_WASM_EXTENSION': "True",
'HAS_EXTENSIONS': "True", 'HAS_EXTENSIONS': "True",
}), }),
BuildJob('list', '6.1.0', 'linux', 'android', '', '', list_options={ BuildJob('list', '6.1.0', 'linux', 'android', '', '', spec=">6.0,<6.1.1", list_options={
'HAS_EXTENSIONS': "True", 'HAS_EXTENSIONS': "True",
'USE_EXTENSION': "armv7", 'USE_EXTENSION': "armv7",
}), }),
# tests run on linux but query data about other platforms # tests run on linux but query data about other platforms
BuildJob('list', '5.14.1', 'mac', 'ios', '', '', list_options={}), BuildJob('list', '5.14.1', 'mac', 'ios', '', '', spec="<=5.14.1", list_options={}),
BuildJob('list', '5.13.1', 'windows', 'winrt', '', '', list_options={}), BuildJob('list', '5.13.1', 'windows', 'winrt', '', '', spec=">5.13.0,<5.13.2", list_options={}),
] ]
) )
mac_build_jobs.extend( mac_build_jobs.extend(
@@ -274,7 +276,7 @@ for platform_build_job in all_platform_build_jobs:
("MODULE", build_job.module if build_job.module else ""), ("MODULE", build_job.module if build_job.module else ""),
("QT_BASE_MIRROR", build_job.mirror if build_job.mirror else ""), ("QT_BASE_MIRROR", build_job.mirror if build_job.mirror else ""),
("SUBARCHIVES", build_job.subarchives if build_job.subarchives else ""), ("SUBARCHIVES", build_job.subarchives if build_job.subarchives else ""),
("HAS_WASM_EXTENSION", build_job.list_options.get("HAS_WASM_EXTENSION", "False")), ("SPEC", build_job.spec if build_job.spec else ""),
("HAS_EXTENSIONS", build_job.list_options.get("HAS_EXTENSIONS", "False")), ("HAS_EXTENSIONS", build_job.list_options.get("HAS_EXTENSIONS", "False")),
("USE_EXTENSION", build_job.list_options.get("USE_EXTENSION", "None")), ("USE_EXTENSION", build_job.list_options.get("USE_EXTENSION", "None")),
("OUTPUT_DIR", build_job.output_dir if build_job.output_dir else ""), ("OUTPUT_DIR", build_job.output_dir if build_job.output_dir else ""),

View File

@@ -65,41 +65,34 @@ steps:
fi fi
fi fi
if [[ "$(SUBCOMMAND)" == "list" ]]; then if [[ "$(SUBCOMMAND)" == "list" ]]; then
qtversion=$(QT_VERSION)
MAJORMINOR=${qtversion%.*}
qtmajor="qt${MAJORMINOR%.*}"
qtminor=${MAJORMINOR##*.}
if [[ $(USE_EXTENSION) != "None" ]]; then if [[ $(USE_EXTENSION) != "None" ]]; then
# In this case, if you don't specify an extension, Updates.xml just shows dependencies # In this case, if you don't specify an extension, Updates.xml just shows dependencies
ext="--extension $(USE_EXTENSION)" ext="--extension $(USE_EXTENSION)"
fi fi
aqt list $qtmajor $(HOST) # print all targets for host aqt list-qt $(HOST) # print all targets for host
aqt list tools $(HOST) $(TARGET) # print all tools for host/target aqt list-tool $(HOST) $(TARGET) # print all tools for host/target
aqt list tools $(HOST) $(TARGET) --tool tools_qt3dstudio_runtime_240 # print all tool variant names for qt3dstudio aqt list-tool $(HOST) $(TARGET) qt3dstudio_runtime_240 # print all tool variant names for qt3dstudio
aqt list tools $(HOST) $(TARGET) --tool-long tools_qt3dstudio_runtime_240 # print tool variant names, versions, release dates aqt list-tool $(HOST) $(TARGET) --long qt3dstudio_runtime_240 # print tool variant names, versions, release dates
if [[ "$(TARGET)" == "desktop" ]]; then if [[ "$(TARGET)" == "desktop" ]]; then
aqt list tools $(HOST) $(TARGET) --tool tools_qtcreator # print all tool variant names for qtcreator aqt list-tool $(HOST) $(TARGET) tools_qtcreator # print all tool variant names for qtcreator
aqt list tools $(HOST) $(TARGET) --tool-long tools_qtcreator # print tool variant names, versions, release dates aqt list-tool $(HOST) $(TARGET) -l tools_qtcreator # print tool variant names, versions, release dates
fi fi
aqt list $qtmajor $(HOST) $(TARGET) # print all versions of Qt aqt list-qt $(HOST) $(TARGET) # print all versions of Qt
if [[ $(HAS_WASM_EXTENSION) == "True" ]]; then aqt list-qt $(HOST) $(TARGET) --extension wasm # print all wasm versions of Qt
aqt list $qtmajor $(HOST) $(TARGET) --extension wasm # print all wasm versions of Qt5 aqt list-qt $(HOST) $(TARGET) $ext --spec "$(SPEC)" # print all versions of Qt in SimpleSpec
else ver=$(aqt list-qt $(HOST) $(TARGET) $ext --spec "$(SPEC)" --latest-version) # latest Qt in SimpleSpec
! aqt list $qtmajor $(HOST) $(TARGET) --extension wasm # Only Qt5 desktop provides wasm extension [ $ver == $(QT_VERSION) ] # latest version in SPEC must be QT_VERSION
fi aqt list-qt $(HOST) $(TARGET) $ext --spec "$(SPEC)" --modules latest # print modules for latest in SimpleSpec
aqt list $qtmajor $(HOST) $(TARGET) $ext --filter-minor $qtminor # print all versions of Qt major/minor aqt list-qt $(HOST) $(TARGET) $ext --modules $(QT_VERSION) # print modules for version/host/target
aqt list $qtmajor $(HOST) $(TARGET) $ext --filter-minor $qtminor --latest-version # print latest Qt major/minor
aqt list $qtmajor $(HOST) $(TARGET) $ext --filter-minor $qtminor --modules latest # print modules for latest major/minor
aqt list $qtmajor $(HOST) $(TARGET) $ext --modules $(QT_VERSION) # print modules for version/host/target
if [[ $(HAS_EXTENSIONS) == "True" ]]; then if [[ $(HAS_EXTENSIONS) == "True" ]]; then
aqt list $qtmajor $(HOST) $(TARGET) --extensions $(QT_VERSION) # print choices for --extension flag aqt list-qt $(HOST) $(TARGET) --extensions $(QT_VERSION) # print choices for --extension flag
aqt list $qtmajor $(HOST) $(TARGET) --filter-minor $qtminor --extensions latest aqt list-qt $(HOST) $(TARGET) --spec "$(SPEC)" --extensions latest
else else
! aqt list $qtmajor $(HOST) $(TARGET) --extensions $(QT_VERSION) ! aqt list-qt $(HOST) $(TARGET) --extensions $(QT_VERSION)
! aqt list $qtmajor $(HOST) $(TARGET) --filter-minor $qtminor --extensions latest ! aqt list-qt $(HOST) $(TARGET) --spec "$(SPEC)" --extensions latest
fi fi
aqt list $qtmajor $(HOST) $(TARGET) $ext --arch $(QT_VERSION) # print architectures for version/host/target aqt list-qt $(HOST) $(TARGET) $ext --arch $(QT_VERSION) # print architectures for version/host/target
aqt list $qtmajor $(HOST) $(TARGET) $ext --filter-minor $qtminor --arch latest aqt list-qt $(HOST) $(TARGET) $ext --spec "$(SPEC)" --arch latest
fi fi
if [[ "$(SUBCOMMAND)" == "src" ]]; then if [[ "$(SUBCOMMAND)" == "src" ]]; then
python -m aqt $(SUBCOMMAND) $(QT_VERSION) $(HOST) $(TARGET) --archives $(SUBARCHIVES) python -m aqt $(SUBCOMMAND) $(QT_VERSION) $(HOST) $(TARGET) --archives $(SUBARCHIVES)

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.9-preview", "5.9-preview",
@@ -16,21 +18,12 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": []
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview", "6.0-preview",
"6.1-preview" "6.1-preview"
], ],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": [], "src_doc_examples": [],
"x86_64": [ "x86_64": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.9-preview", "5.9-preview",
@@ -16,7 +18,9 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
"6.0-preview",
"6.1-preview"
], ],
"wasm": [ "wasm": [
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
@@ -35,19 +39,7 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
]
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview",
"6.1-preview"
],
"src_doc_examples": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0" "6.1.0"
] ]

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.9-preview", "5.9-preview",
@@ -16,21 +18,12 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": []
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview", "6.0-preview",
"6.1-preview" "6.1-preview"
], ],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": [], "src_doc_examples": [],
"x86_64": [ "x86_64": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.6-preview", "5.6-preview",
@@ -17,7 +19,9 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
"6.0-preview",
"6.1-preview"
], ],
"wasm": [ "wasm": [
"5.13.1 5.13.2", "5.13.1 5.13.2",
@@ -36,19 +40,7 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
]
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview",
"6.1-preview"
],
"src_doc_examples": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0" "6.1.0"
] ]

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.9-preview", "5.9-preview",
@@ -16,21 +18,12 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": []
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview", "6.0-preview",
"6.1-preview" "6.1-preview"
], ],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": [] "src_doc_examples": []
}, },
"tools": [ "tools": [

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.9-preview", "5.9-preview",
@@ -16,21 +18,12 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": []
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview", "6.0-preview",
"6.1-preview" "6.1-preview"
], ],
"wasm": [],
"wasm_preview": [],
"src_doc_examples": [], "src_doc_examples": [],
"x86_64": [ "x86_64": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -7,7 +7,9 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
], ],
"preview": [ "preview": [
"5.6-preview", "5.6-preview",
@@ -17,7 +19,9 @@
"5.12-preview", "5.12-preview",
"5.13-preview", "5.13-preview",
"5.14-preview", "5.14-preview",
"5.15-preview" "5.15-preview",
"6.0-preview",
"6.1-preview"
], ],
"wasm": [ "wasm": [
"5.13.1 5.13.2", "5.13.1 5.13.2",
@@ -42,19 +46,7 @@
"5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10", "5.12.0 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.12.7 5.12.8 5.12.9 5.12.10",
"5.13.0 5.13.1 5.13.2", "5.13.0 5.13.1 5.13.2",
"5.14.0 5.14.1 5.14.2", "5.14.0 5.14.1 5.14.2",
"5.15.0 5.15.1 5.15.2" "5.15.0 5.15.1 5.15.2",
]
},
"qt6": {
"qt": [
"6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0"
],
"preview": [
"6.0-preview",
"6.1-preview"
],
"src_doc_examples": [
"6.0.0 6.0.1 6.0.2 6.0.3", "6.0.0 6.0.1 6.0.2 6.0.3",
"6.1.0" "6.1.0"
] ]

View File

@@ -1,5 +1,5 @@
{ {
"qt5": { "qt": {
"qt": [ "qt": [
"5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9", "5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9",
"5.10.0 5.10.1", "5.10.0 5.10.1",
@@ -22,11 +22,6 @@
"wasm_preview": [], "wasm_preview": [],
"src_doc_examples": [] "src_doc_examples": []
}, },
"qt6": {
"qt": [],
"preview": [],
"src_doc_examples": []
},
"tools": [ "tools": [
"tools_qt3dstudio_runtime_preview", "tools_qt3dstudio_runtime_preview",
"tools_qt3dstudio_runtime_240", "tools_qt3dstudio_runtime_240",

View File

@@ -11,7 +11,7 @@ def test_cli_help(capsys):
expected = "".join( expected = "".join(
[ [
"usage: aqt [-h] [-c CONFIG]\n", "usage: aqt [-h] [-c CONFIG]\n",
" {install,doc,examples,src,tool,list,help,version} ...\n", " {install,doc,examples,src,tool,list-qt,list-tool,help,version} ...\n",
"\n", "\n",
"Installer for Qt SDK.\n", "Installer for Qt SDK.\n",
"\n", "\n",
@@ -23,7 +23,7 @@ def test_cli_help(capsys):
"subcommands:\n", "subcommands:\n",
" Valid subcommands\n", " Valid subcommands\n",
"\n", "\n",
" {install,doc,examples,src,tool,list,help,version}\n", " {install,doc,examples,src,tool,list-qt,list-tool,help,version}\n",
" subcommand for aqt Qt installer\n", " subcommand for aqt Qt installer\n",
] ]
) )
@@ -81,7 +81,7 @@ def test_cli_invalid_version(capsys, invalid_version):
for cmd in ( for cmd in (
("install", invalid_version, "mac", "desktop"), ("install", invalid_version, "mac", "desktop"),
("doc", invalid_version, "mac", "desktop"), ("doc", invalid_version, "mac", "desktop"),
("list", "qt5", "mac", "desktop", "--modules", invalid_version), ("list-qt", "mac", "desktop", "--modules", invalid_version),
): ):
with pytest.raises(SystemExit) as pytest_wrapped_e: with pytest.raises(SystemExit) as pytest_wrapped_e:
cli = Cli() cli = Cli()
@@ -108,7 +108,7 @@ def test_cli_launch_with_no_argument(capsys):
expected = "".join( expected = "".join(
[ [
"usage: aqt [-h] [-c CONFIG]\n", "usage: aqt [-h] [-c CONFIG]\n",
" {install,doc,examples,src,tool,list,help,version} ...\n", " {install,doc,examples,src,tool,list-qt,list-tool,help,version} ...\n",
"\n", "\n",
"Installer for Qt SDK.\n", "Installer for Qt SDK.\n",
"\n", "\n",
@@ -120,7 +120,7 @@ def test_cli_launch_with_no_argument(capsys):
"subcommands:\n", "subcommands:\n",
" Valid subcommands\n", " Valid subcommands\n",
"\n", "\n",
" {install,doc,examples,src,tool,list,help,version}\n", " {install,doc,examples,src,tool,list-qt,list-tool,help,version}\n",
" subcommand for aqt Qt installer\n", " subcommand for aqt Qt installer\n",
] ]
) )

View File

@@ -4,7 +4,7 @@ import re
import shutil import shutil
import sys import sys
from pathlib import Path from pathlib import Path
from typing import Generator from typing import Dict, Generator, Set, Union
import pytest import pytest
@@ -69,7 +69,7 @@ def test_versions():
assert pytest_wrapped_e.type == TypeError assert pytest_wrapped_e.type == TypeError
MINOR_REGEX = re.compile(r"^\d+\.(\d+)") SPEC_REGEX = re.compile(r"^(\d+\.\d+)")
@pytest.mark.parametrize( @pytest.mark.parametrize(
@@ -93,11 +93,11 @@ def test_list_versions_tools(monkeypatch, os_name, target, in_file, expect_out_f
(Path(__file__).parent / "data" / expect_out_file).read_text("utf-8") (Path(__file__).parent / "data" / expect_out_file).read_text("utf-8")
) )
# Test 'aqt list tools' # Test 'aqt list-tool'
tools = MetadataFactory(ArchiveId("tools", os_name, target)).getList() tools = MetadataFactory(ArchiveId("tools", os_name, target)).getList()
assert tools == expected["tools"] assert tools == expected["tools"]
for qt in ("qt5", "qt6"): for qt in ("qt",):
for ext, expected_output in expected[qt].items(): for ext, expected_output in expected[qt].items():
# Test 'aqt list qt' # Test 'aqt list qt'
archive_id = ArchiveId(qt, os_name, target, ext if ext != "qt" else "") archive_id = ArchiveId(qt, os_name, target, ext if ext != "qt" else "")
@@ -117,22 +117,27 @@ def test_list_versions_tools(monkeypatch, os_name, target, in_file, expect_out_f
assert f"{latest_ver}" == expected_output[-1].split(" ")[-1] assert f"{latest_ver}" == expected_output[-1].split(" ")[-1]
for row in expected_output: for row in expected_output:
minor = int(MINOR_REGEX.search(row).group(1)) spec_str = SPEC_REGEX.search(row).group(1)
spec = (
SimpleSpec(spec_str)
if not ext.endswith("preview")
else SimpleSpec(spec_str + ".0-preview")
)
# Find the latest version for a particular minor version # Find the latest version for a particular spec
latest_ver_for_minor = MetadataFactory( latest_ver_for_spec = MetadataFactory(
archive_id, archive_id,
filter_minor=minor, spec=spec,
is_latest_version=True, is_latest_version=True,
).getList() ).getList()
assert f"{latest_ver_for_minor}" == row.split(" ")[-1] assert f"{latest_ver_for_spec}" == row.split(" ")[-1]
# Find all versions for a particular minor version # Find all versions for a particular spec
all_ver_for_minor = MetadataFactory( all_ver_for_spec = MetadataFactory(
archive_id, archive_id,
filter_minor=minor, spec=spec,
).getList() ).getList()
assert f"{all_ver_for_minor}" == row assert f"{all_ver_for_spec}" == row
@pytest.mark.parametrize( @pytest.mark.parametrize(
@@ -151,7 +156,7 @@ def test_list_versions_tools(monkeypatch, os_name, target, in_file, expect_out_f
def test_list_architectures_and_modules( def test_list_architectures_and_modules(
monkeypatch, version: str, extension: str, in_file: str, expect_out_file: str monkeypatch, version: str, extension: str, in_file: str, expect_out_file: str
): ):
archive_id = ArchiveId("qt" + version[0], "windows", "desktop", extension) archive_id = ArchiveId("qt", "windows", "desktop", extension)
_xml = (Path(__file__).parent / "data" / in_file).read_text("utf-8") _xml = (Path(__file__).parent / "data" / in_file).read_text("utf-8")
expect = json.loads( expect = json.loads(
(Path(__file__).parent / "data" / expect_out_file).read_text("utf-8") (Path(__file__).parent / "data" / expect_out_file).read_text("utf-8")
@@ -188,18 +193,19 @@ def test_tool_modules(monkeypatch, host: str, target: str, tool_name: str):
modules = MetadataFactory(archive_id, tool_name=tool_name).getList() modules = MetadataFactory(archive_id, tool_name=tool_name).getList()
assert modules == expect["modules"] assert modules == expect["modules"]
table = MetadataFactory(archive_id, tool_long_listing=tool_name).getList() table = MetadataFactory(
archive_id, tool_name=tool_name, is_long_listing=True
).getList()
assert table._rows() == expect["long_listing"] assert table._rows() == expect["long_listing"]
@pytest.mark.parametrize( @pytest.mark.parametrize(
"cat, host, target, minor_ver, ver, ext, xmlfile, xmlexpect, htmlfile, htmlexpect", "host, target, spec, ver, ext, xmlfile, xmlexpect, htmlfile, htmlexpect",
[ [
( (
"qt5",
"windows", "windows",
"desktop", "desktop",
"14", "5.14",
"5.14.0", "5.14.0",
"wasm", "wasm",
"windows-5140-update.xml", "windows-5140-update.xml",
@@ -209,13 +215,12 @@ def test_tool_modules(monkeypatch, host: str, target: str, tool_name: str):
), ),
], ],
) )
def test_list_cli( def test_list_qt_cli(
capsys, capsys,
monkeypatch, monkeypatch,
cat,
host, host,
target, target,
minor_ver, spec,
ver, ver,
ext, ext,
xmlfile, xmlfile,
@@ -258,42 +263,42 @@ def test_list_cli(
out, err = capsys.readouterr() out, err = capsys.readouterr()
assert set(out.strip().split()) == set(expect_arches) assert set(out.strip().split()) == set(expect_arches)
_minor = ["--filter-minor", minor_ver] _spec = ["--spec", spec]
_ext = ["--extension", ext] _ext = ["--extension", ext]
cli = Cli() cli = Cli()
# Query extensions by latest version, minor version, and specific version # Query extensions by latest version, spec, and specific version
cli.run(["list", cat, host, target, "--extensions", "latest"]) cli.run(["list-qt", host, target, "--extensions", "latest"])
check_extensions() check_extensions()
cli.run(["list", cat, host, target, *_minor, "--extensions", "latest"]) cli.run(["list-qt", host, target, *_spec, "--extensions", "latest"])
check_extensions() check_extensions()
cli.run(["list", cat, host, target, "--extensions", ver]) cli.run(["list-qt", host, target, "--extensions", ver])
check_extensions() check_extensions()
# Query modules by latest version, minor version, and specific version # Query modules by latest version, spec, and specific version
cli.run(["list", cat, host, target, "--modules", "latest"]) cli.run(["list-qt", host, target, "--modules", "latest"])
check_modules() check_modules()
cli.run(["list", cat, host, target, *_minor, "--modules", "latest"]) cli.run(["list-qt", host, target, *_spec, "--modules", "latest"])
check_modules() check_modules()
cli.run(["list", cat, host, target, "--modules", ver]) cli.run(["list-qt", host, target, "--modules", ver])
check_modules() check_modules()
cli.run(["list", cat, host, target, *_ext, "--modules", "latest"]) cli.run(["list-qt", host, target, *_ext, "--modules", "latest"])
check_modules() check_modules()
cli.run(["list", cat, host, target, *_ext, *_minor, "--modules", "latest"]) cli.run(["list-qt", host, target, *_ext, *_spec, "--modules", "latest"])
check_modules() check_modules()
cli.run(["list", cat, host, target, *_ext, "--modules", ver]) cli.run(["list-qt", host, target, *_ext, "--modules", ver])
check_modules() check_modules()
# Query architectures by latest version, minor version, and specific version # Query architectures by latest version, spec, and specific version
cli.run(["list", cat, host, target, "--arch", "latest"]) cli.run(["list-qt", host, target, "--arch", "latest"])
check_arches() check_arches()
cli.run(["list", cat, host, target, *_minor, "--arch", "latest"]) cli.run(["list-qt", host, target, *_spec, "--arch", "latest"])
check_arches() check_arches()
cli.run(["list", cat, host, target, "--arch", ver]) cli.run(["list-qt", host, target, "--arch", ver])
check_arches() check_arches()
cli.run(["list", cat, host, target, *_ext, "--arch", "latest"]) cli.run(["list-qt", host, target, *_ext, "--arch", "latest"])
check_arches() check_arches()
cli.run(["list", cat, host, target, *_ext, *_minor, "--arch", "latest"]) cli.run(["list-qt", host, target, *_ext, *_spec, "--arch", "latest"])
check_arches() check_arches()
cli.run(["list", cat, host, target, *_ext, "--arch", ver]) cli.run(["list-qt", host, target, *_ext, "--arch", ver])
check_arches() check_arches()
@@ -354,67 +359,66 @@ def test_list_invalid_extensions(
monkeypatch.setattr(MetadataFactory, "fetch_http", _mock) monkeypatch.setattr(MetadataFactory, "fetch_http", _mock)
cat = "qt" + version[0]
host = "windows" host = "windows"
extension_params = ["--extension", ext] if ext else [] extension_params = ["--extension", ext] if ext else []
cli = Cli() cli = Cli()
cli.run(["list", cat, host, target, *extension_params, "--arch", version]) cli.run(["list-qt", host, target, *extension_params, "--arch", version])
out, err = capsys.readouterr() out, err = capsys.readouterr()
sys.stdout.write(out) sys.stdout.write(out)
sys.stderr.write(err) sys.stderr.write(err)
assert expected_msg in err assert expected_msg in err
mac_qt5 = ArchiveId("qt5", "mac", "desktop") mac_qt = ArchiveId("qt", "mac", "desktop")
mac_wasm = ArchiveId("qt5", "mac", "desktop", "wasm") mac_wasm = ArchiveId("qt", "mac", "desktop", "wasm")
wrong_qt_version_msg = [ wrong_qt_version_msg = [
"Please use 'aqt list qt5 mac desktop' to show versions of Qt available." "Please use 'aqt list-qt mac desktop' to show versions of Qt available."
] ]
wrong_ext_and_version_msg = [ wrong_ext_and_version_msg = [
"Please use 'aqt list qt5 mac desktop --extensions <QT_VERSION>' to list valid extensions.", "Please use 'aqt list-qt mac desktop --extensions <QT_VERSION>' to list valid extensions.",
"Please use 'aqt list qt5 mac desktop' to show versions of Qt available.", "Please use 'aqt list-qt mac desktop' to show versions of Qt available.",
] ]
@pytest.mark.parametrize( @pytest.mark.parametrize(
"meta, expected_message", "meta, expected_message",
( (
(MetadataFactory(mac_qt5), []), (MetadataFactory(mac_qt), []),
( (
MetadataFactory(mac_qt5, filter_minor=0), MetadataFactory(mac_qt, spec=SimpleSpec("5.0")),
[ [
"Please use 'aqt list qt5 mac desktop' to check that versions of qt5 exist with the minor version '0'." "Please use 'aqt list-qt mac desktop' to check that versions of qt exist within the spec '5.0'."
], ],
), ),
( (
MetadataFactory(ArchiveId("tools", "mac", "desktop"), tool_name="ifw"), MetadataFactory(ArchiveId("tools", "mac", "desktop"), tool_name="ifw"),
[ [
"Please use 'aqt list tools mac desktop' to check what tools are available." "Please use 'aqt list-tool mac desktop' to check what tools are available."
], ],
), ),
( (
MetadataFactory(mac_qt5, architectures_ver="1.2.3"), MetadataFactory(mac_qt, architectures_ver="1.2.3"),
wrong_qt_version_msg, wrong_qt_version_msg,
), ),
( (
MetadataFactory(mac_qt5, modules_ver="1.2.3"), MetadataFactory(mac_qt, modules_ver="1.2.3"),
wrong_qt_version_msg, wrong_qt_version_msg,
), ),
( (
MetadataFactory(mac_qt5, extensions_ver="1.2.3"), MetadataFactory(mac_qt, extensions_ver="1.2.3"),
wrong_qt_version_msg, wrong_qt_version_msg,
), ),
( (
MetadataFactory(mac_wasm), MetadataFactory(mac_wasm),
[ [
"Please use 'aqt list qt5 mac desktop --extensions <QT_VERSION>' to list valid extensions." "Please use 'aqt list-qt mac desktop --extensions <QT_VERSION>' to list valid extensions."
], ],
), ),
( (
MetadataFactory(mac_wasm, filter_minor=0), MetadataFactory(mac_wasm, spec=SimpleSpec("<5.9")),
[ [
"Please use 'aqt list qt5 mac desktop --extensions <QT_VERSION>' to list valid extensions.", "Please use 'aqt list-qt mac desktop --extensions <QT_VERSION>' to list valid extensions.",
"Please use 'aqt list qt5 mac desktop' to check that versions of qt5 exist with the minor version '0'.", "Please use 'aqt list-qt mac desktop' to check that versions of qt exist within the spec '<5.9'.",
], ],
), ),
( (
@@ -422,8 +426,8 @@ wrong_ext_and_version_msg = [
ArchiveId("tools", "mac", "desktop", "wasm"), tool_name="ifw" ArchiveId("tools", "mac", "desktop", "wasm"), tool_name="ifw"
), ),
[ [
"Please use 'aqt list tools mac desktop --extensions <QT_VERSION>' to list valid extensions.", "Please use 'aqt list-tool mac desktop --extensions <QT_VERSION>' to list valid extensions.",
"Please use 'aqt list tools mac desktop' to check what tools are available.", "Please use 'aqt list-tool mac desktop' to check what tools are available.",
], ],
), ),
( (
@@ -446,13 +450,13 @@ def test_suggested_follow_up(meta: MetadataFactory, expected_message: str):
def test_format_suggested_follow_up(): def test_format_suggested_follow_up():
suggestions = [ suggestions = [
"Please use 'aqt list tools mac desktop --extensions <QT_VERSION>' to list valid extensions.", "Please use 'aqt list-tool mac desktop --extensions <QT_VERSION>' to list valid extensions.",
"Please use 'aqt list tools mac desktop' to check what tools are available.", "Please use 'aqt list-tool mac desktop' to check what tools are available.",
] ]
expected = ( expected = (
"==============================Suggested follow-up:==============================\n" "==============================Suggested follow-up:==============================\n"
"* Please use 'aqt list tools mac desktop --extensions <QT_VERSION>' to list valid extensions.\n" "* Please use 'aqt list-tool mac desktop --extensions <QT_VERSION>' to list valid extensions.\n"
"* Please use 'aqt list tools mac desktop' to check what tools are available." "* Please use 'aqt list-tool mac desktop' to check what tools are available."
) )
assert format_suggested_follow_up(suggestions) == expected assert format_suggested_follow_up(suggestions) == expected
@@ -466,19 +470,19 @@ def test_format_suggested_follow_up_empty():
"meta, expect", "meta, expect",
( (
( (
MetadataFactory(ArchiveId("qt5", "mac", "desktop"), filter_minor=42), MetadataFactory(ArchiveId("qt", "mac", "desktop"), spec=SimpleSpec("5.42")),
"qt5/mac/desktop with minor version 42", "qt/mac/desktop with spec 5.42",
), ),
( (
MetadataFactory( MetadataFactory(
ArchiveId("qt5", "mac", "desktop", "wasm"), filter_minor=42 ArchiveId("qt", "mac", "desktop", "wasm"), spec=SimpleSpec("5.42")
), ),
"qt5/mac/desktop/wasm with minor version 42", "qt/mac/desktop/wasm with spec 5.42",
), ),
(MetadataFactory(ArchiveId("qt5", "mac", "desktop")), "qt5/mac/desktop"), (MetadataFactory(ArchiveId("qt", "mac", "desktop")), "qt/mac/desktop"),
( (
MetadataFactory(ArchiveId("qt5", "mac", "desktop", "wasm")), MetadataFactory(ArchiveId("qt", "mac", "desktop", "wasm")),
"qt5/mac/desktop/wasm", "qt/mac/desktop/wasm",
), ),
), ),
) )
@@ -487,50 +491,37 @@ def test_list_describe_filters(meta: MetadataFactory, expect: str):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"archive_id, filter_minor, version_str, expect", "archive_id, spec, version_str, expect",
( (
(mac_qt5, None, "5.12.42", Version("5.12.42")), (mac_qt, None, "5.12.42", Version("5.12.42")),
( (
mac_qt5, mac_qt,
None,
"6.12.42",
CliInputError("Major version mismatch between qt5 and 6.12.42"),
),
(
mac_qt5,
None, None,
"not a version", "not a version",
CliInputError("Invalid version string: 'not a version'"), CliInputError("Invalid version string: 'not a version'"),
), ),
(mac_qt5, None, "latest", Version("5.15.2")), (mac_qt, SimpleSpec("5"), "latest", Version("5.15.2")),
( (
mac_qt5, mac_qt,
0, SimpleSpec("5.0"),
"latest", "latest",
CliInputError( CliInputError(
"There is no latest version of Qt with the criteria 'qt5/mac/desktop with minor version 0'" "There is no latest version of Qt with the criteria 'qt/mac/desktop with spec 5.0'"
), ),
), ),
), ),
) )
def test_list_to_version(monkeypatch, archive_id, filter_minor, version_str, expect): def test_list_to_version(monkeypatch, archive_id, spec, version_str, expect):
_html = (Path(__file__).parent / "data" / "mac-desktop.html").read_text("utf-8") _html = (Path(__file__).parent / "data" / "mac-desktop.html").read_text("utf-8")
monkeypatch.setattr(MetadataFactory, "fetch_http", lambda self, _: _html) monkeypatch.setattr(MetadataFactory, "fetch_http", lambda self, _: _html)
if isinstance(expect, Exception): if isinstance(expect, Exception):
with pytest.raises(CliInputError) as error: with pytest.raises(CliInputError) as error:
MetadataFactory(archive_id, filter_minor=filter_minor)._to_version( MetadataFactory(archive_id, spec=spec)._to_version(version_str)
version_str
)
assert error.type == CliInputError assert error.type == CliInputError
assert str(expect) == str(error.value) assert str(expect) == str(error.value)
else: else:
assert ( assert MetadataFactory(archive_id, spec=spec)._to_version(version_str) == expect
MetadataFactory(archive_id, filter_minor=filter_minor)._to_version(
version_str
)
== expect
)
def test_list_fetch_tool_by_simple_spec(monkeypatch): def test_list_fetch_tool_by_simple_spec(monkeypatch):
@@ -635,7 +626,9 @@ def test_show_list_tools_long_ifw(capsys, monkeypatch, columns, expect):
) )
meta = MetadataFactory( meta = MetadataFactory(
ArchiveId("tools", "mac", "desktop"), tool_long_listing="tools_ifw" ArchiveId("tools", "mac", "desktop"),
tool_name="tools_ifw",
is_long_listing=True,
) )
assert show_list(meta) == 0 assert show_list(meta) == 0
out, err = capsys.readouterr() out, err = capsys.readouterr()
@@ -649,9 +642,9 @@ def test_show_list_versions(monkeypatch, capsys):
monkeypatch.setattr(MetadataFactory, "fetch_http", lambda *args: _html) monkeypatch.setattr(MetadataFactory, "fetch_http", lambda *args: _html)
expect_file = Path(__file__).parent / "data" / "mac-desktop-expect.json" expect_file = Path(__file__).parent / "data" / "mac-desktop-expect.json"
expected = "\n".join(json.loads(expect_file.read_text("utf-8"))["qt5"]["qt"]) + "\n" expected = "\n".join(json.loads(expect_file.read_text("utf-8"))["qt"]["qt"]) + "\n"
assert show_list(MetadataFactory(mac_qt5)) == 0 assert show_list(MetadataFactory(mac_qt)) == 0
out, err = capsys.readouterr() out, err = capsys.readouterr()
assert out == expected assert out == expected