Test Windows installer contents and build error propagation
This commit is contained in:
1 parent
6d3c555ac4
commit
804007c997
2 files changed
+221
No files matched your search
@@ -218,6 +218,21 @@ esac
|
||||
result = run(['bash', 'build.sh', '-j', '3'], ok=False)
|
||||
check('GUI failure propagates and success is not printed', result.returncode != 0 and 'Build completed successfully!' not in result.stdout)
|
||||
check('GUI receives selected job count', (base / 'gui-arguments').read_text().strip() == '--build tools/chatgui/build --parallel 3')
|
||||
(base / 'tools/chatgui/build/CMakeCache.txt').unlink()
|
||||
write('tools/chatgui/package_win.sh', '''#!/usr/bin/env bash
|
||||
printf '%s\\n' "$*" > installer-preflight
|
||||
[[ "${MSYSTEM:-}" = UCRT64 ]] || { echo 'ERROR: installer requires UCRT64'; exit 1; }
|
||||
''')
|
||||
write('tools/chatgui/build.sh', '#!/usr/bin/env bash\nprintf "%s\\n" "$*" > gui-installer-arguments\nexit 9\n')
|
||||
result = run(['bash', 'build.sh', '--installer', '-j5'], ok=False, extra_environment={'MSYSTEM': 'UCRT64'})
|
||||
check('installer builds GUI without an existing CMake cache',
|
||||
(base / 'tools/chatgui/gui-installer-arguments').read_text().strip() == '-j5 --installer')
|
||||
check('installer preflight runs before building', (base / 'installer-preflight').read_text().strip() == '--check')
|
||||
check('installer failure propagates through the root build', result.returncode != 0 and 'Build completed successfully!' not in result.stdout)
|
||||
result = run(['bash', 'build.sh', '--installer'], ok=False)
|
||||
check('installer requires a Windows build environment', result.returncode != 0 and 'ERROR: installer requires UCRT64' in result.stdout)
|
||||
result = run(['bash', 'build.sh', '--installer', '--no-gui'], ok=False)
|
||||
check('installer rejects a disabled GUI', result.returncode != 0 and '--installer requires GUI' in result.stderr)
|
||||
run(['make', 'distclean'])
|
||||
output_dir = base / 'out'
|
||||
output_dir.mkdir()
|
||||
|
||||
Reference in new issue
Block a user