forked from HasflarSonto/Truely
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_app.py
More file actions
71 lines (58 loc) · 2.2 KB
/
test_app.py
File metadata and controls
71 lines (58 loc) · 2.2 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
#!/usr/bin/env python3
"""
Test script to verify Truely.app works without crashing
"""
import subprocess
import time
import signal
import os
def test_app():
"""Test the Truely.app by running it and checking if it starts successfully"""
app_path = "distribution/Truely.app"
if not os.path.exists(app_path):
print("❌ Truely.app not found in distribution folder")
return False
print("🧪 Testing Truely.app...")
print(f"📁 App path: {app_path}")
try:
# Start the app
print("🚀 Starting Truely.app...")
process = subprocess.Popen(
["open", app_path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# Wait a moment for the app to start
time.sleep(3)
# Check if the process is still running
if process.poll() is None:
print("✅ Truely.app started successfully!")
print("⏱️ App is running for 10 seconds to test stability...")
# Let it run for 10 seconds to test stability
time.sleep(10)
# Try to gracefully close the app
print("🛑 Attempting to close Truely.app...")
try:
subprocess.run(["pkill", "-f", "Truely"], check=False)
print("✅ Truely.app closed successfully")
except Exception as e:
print(f"⚠️ Warning: Could not close app gracefully: {e}")
return True
else:
stdout, stderr = process.communicate()
print(f"❌ Truely.app failed to start")
print(f"stdout: {stdout.decode()}")
print(f"stderr: {stderr.decode()}")
return False
except Exception as e:
print(f"❌ Error testing Truely.app: {e}")
return False
if __name__ == "__main__":
success = test_app()
if success:
print("\n🎉 Truely.app test PASSED!")
print("✅ The app starts and runs without crashing")
print("✅ Location services crash has been fixed")
else:
print("\n💥 Truely.app test FAILED!")
print("❌ The app still has issues")