-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest_build_setup.py
More file actions
105 lines (81 loc) · 2.38 KB
/
Copy pathtest_build_setup.py
File metadata and controls
105 lines (81 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env python3
"""
Test script to verify the executable build process works
"""
import subprocess
import sys
from pathlib import Path
def test_dependencies():
"""Test that all required dependencies are available."""
print("Testing dependencies...")
# Test Python modules
required_modules = [
"setuptools",
"fastapi",
"uvicorn",
"pygame",
"httpx",
"jinja2",
]
for module in required_modules:
try:
__import__(module)
print(f" ✓ {module}")
except ImportError:
print(f" ✗ {module} (missing)")
return False
return True
def test_build_tools():
"""Test that build tools are available."""
print("\nTesting build tools...")
# Test PyInstaller
try:
subprocess.run(
[sys.executable, "-m", "PyInstaller", "--version"],
check=True,
capture_output=True,
)
print(" ✓ PyInstaller")
except (subprocess.CalledProcessError, FileNotFoundError):
print(" ✗ PyInstaller (install with: pip install pyinstaller)")
return False
return True
def test_files():
"""Test that all required files exist."""
print("\nTesting required files...")
required_files = [
"setup.py",
"infinity_arcade.spec",
"build_exe.ps1",
"src/infinity_arcade/__init__.py",
"src/infinity_arcade/main.py",
"src/infinity_arcade/cli.py",
]
for file_path in required_files:
if Path(file_path).exists():
print(f" ✓ {file_path}")
else:
print(f" ✗ {file_path} (missing)")
return False
return True
def main():
"""Run all tests."""
print("Infinity Arcade Executable Build Test")
print("=" * 38)
success = True
success &= test_dependencies()
success &= test_build_tools()
success &= test_files()
print("\n" + "=" * 38)
if success:
print("✓ All tests passed! Ready to build executable.")
print("\nTo build the executable, run:")
print(" PowerShell: .\\build_exe.ps1")
print(" Python: python -m PyInstaller infinity_arcade.spec")
else:
print("✗ Some tests failed. Please fix the issues above.")
return 1
return 0
if __name__ == "__main__":
sys.exit(main())
# Copyright (c) 2025 AMD