File tree Expand file tree Collapse file tree 4 files changed +33
-7
lines changed Expand file tree Collapse file tree 4 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ requires = []
35
35
[tool .briefcase .app .testbed .iOS ]
36
36
requires = [
37
37
" rubicon-objc" ,
38
+ " std-nslog" ,
38
39
]
39
- template = " ../../../../templates/briefcase-iOS-Xcode-template"
40
- # template_branch = "m1-compile"
40
+ template_branch = " m1-compile"
41
41
support_package = " ../../dist/Python-3.10-iOS-support.custom.tar.gz"
42
42
43
43
[tool .briefcase .app .testbed .android ]
Original file line number Diff line number Diff line change 1
1
"""
2
2
A testbed for the Apple Support packages.
3
3
"""
4
+ import importlib
4
5
import platform
5
6
import sys
6
7
import traceback
7
8
8
9
from . import common
9
- from . import macos
10
10
11
11
12
12
def discover_tests (module ):
@@ -24,10 +24,15 @@ def main():
24
24
print (f"Python { platform .python_version ()} Apple Support verification suite" )
25
25
print (f"Running on { platform .platform ()} " )
26
26
print ("=" * 80 )
27
- # Discover the suite
27
+ # Discover the common test suite
28
28
suite = discover_tests (common )
29
- if sys .platform == "darwin" :
30
- suite .extend (discover_tests (macos ))
29
+
30
+ # Discover the platform-specific tests
31
+ try :
32
+ module = importlib .import_module (f".{ sys .platform } " , "testbed" )
33
+ suite .extend (discover_tests (module ))
34
+ except ModuleNotFoundError :
35
+ print (f"No platform-specific tests for { sys .platform } " )
31
36
32
37
# Run the suite
33
38
failures = 0
@@ -52,4 +57,4 @@ def main():
52
57
53
58
print ("=" * 80 )
54
59
print (f"Tests complete; { tests } tests, { failures } failures." )
55
- sys .exit (int ( failures != 0 ) )
60
+ sys .exit (failures )
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ from rubicon .objc import ObjCClass
2
+
3
+ from .utils import assert_
4
+
5
+
6
+ UIResponder = ObjCClass ('UIResponder' )
7
+
8
+ # iOS apps need an AppDelegate or they crash
9
+ class PythonAppDelegate (UIResponder ):
10
+ pass
11
+
12
+
13
+ def test_subprocess ():
14
+ "Subprocesses should raise exceptions"
15
+ import subprocess
16
+
17
+ try :
18
+ subprocess .call (['uname' , '-a' ])
19
+ raise AssertionError ('Subprocesses should not be possible' )
20
+ except RuntimeError as e :
21
+ assert_ (str (e ) == "Subprocesses are not supported on ios" )
You can’t perform that action at this time.
0 commit comments