Skip to content

Commit 290c312

Browse files
committed
Add testbed for tvOS
1 parent 7926253 commit 290c312

17 files changed

Lines changed: 1457 additions & 1 deletion

File tree

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Lib/test/data/*
7171
/Makefile
7272
/Makefile.pre
7373
/iOSTestbed.*
74+
/tvOSTestbed.*
7475
/visionOSTestbed.*
7576
iOS/Frameworks/
7677
iOS/Resources/Info.plist
@@ -82,6 +83,14 @@ iOS/testbed/Python.xcframework/ios-*/Python.framework
8283
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
8384
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
8485
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
86+
tvOS/testbed/build
87+
tvOS/testbed/Python.xcframework/tvos-*/bin
88+
tvOS/testbed/Python.xcframework/tvos-*/include
89+
tvOS/testbed/Python.xcframework/tvos-*/lib
90+
tvOS/testbed/Python.xcframework/tvos-*/Python.framework
91+
tvOS/testbed/tvOSTestbed.xcodeproj/project.xcworkspace
92+
tvOS/testbed/tvOSTestbed.xcodeproj/xcuserdata
93+
tvOS/testbed/tvOSTestbed.xcodeproj/xcshareddata
8594
visionOS/testbed/Python.xcframework/xros-*/bin
8695
visionOS/testbed/Python.xcframework/xros-*/include
8796
visionOS/testbed/Python.xcframework/xros-*/lib

Makefile.pre.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,36 @@ testvisionos:
23262326
# Run the testbed project
23272327
$(PYTHON_FOR_BUILD) "$(XCFOLDER-visionOS)" run --verbose -- test -uall --single-process --rerun -W
23282328

2329+
# Run the test suite on the tvOS simulator. Must be run on a macOS machine with
2330+
# a full Xcode install that has an iPhone SE (3rd edition) simulator available.
2331+
# This must be run *after* a `make install` has completed the build. The
2332+
# `--with-framework-name` argument *cannot* be used when configuring the build.
2333+
XCFOLDER-tvOS:=tvOSTestbed.$(MULTIARCH).$(shell date +%s).$$PPID
2334+
.PHONY: testtvos
2335+
testtvos:
2336+
@if test "$(MACHDEP)" != "tvos"; then \
2337+
echo "Cannot run the tvOS testbed for a non-tvOS build."; \
2338+
exit 1;\
2339+
fi
2340+
@if test "$(findstring -appletvsimulator,$(MULTIARCH))" != "-appletvsimulator"; then \
2341+
echo "Cannot run the tvOS testbed for non-simulator builds."; \
2342+
exit 1;\
2343+
fi
2344+
@if test $(PYTHONFRAMEWORK) != "Python"; then \
2345+
echo "Cannot run the tvOS testbed with a non-default framework name."; \
2346+
exit 1;\
2347+
fi
2348+
@if ! test -d $(PYTHONFRAMEWORKPREFIX); then \
2349+
echo "Cannot find a finalized tvOS Python.framework. Have you run 'make install' to finalize the framework build?"; \
2350+
exit 1;\
2351+
fi
2352+
2353+
# Clone the testbed project into the XCFOLDER-tvOS
2354+
$(PYTHON_FOR_BUILD) $(srcdir)/tvOS/testbed clone --framework $(PYTHONFRAMEWORKPREFIX) "$(XCFOLDER-tvOS)"
2355+
2356+
# Run the testbed project
2357+
$(PYTHON_FOR_BUILD) "$(XCFOLDER-tvOS)" run --verbose -- test -uall --single-process --rerun -W
2358+
23292359
# Like test, but using --slow-ci which enables all test resources and use
23302360
# longer timeout. Run an optional pybuildbot.identify script to include
23312361
# information about the build environment.

tvOS/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ tvOS builds of Python *must* be constructed as framework builds. To support this
6666
you must provide the ``--enable-framework`` flag when configuring the build.
6767

6868
The build also requires the use of cross-compilation. The commands for building
69-
Python for tvOS will look somethign like::
69+
Python for tvOS will look something like::
7070

71+
$ export PATH="$(pwd)/tvOS/Resources/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin"
7172
$ ./configure \
7273
--enable-framework=/path/to/install \
7374
--host=aarch64-apple-tvos \
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AvailableLibraries</key>
6+
<array>
7+
<dict>
8+
<key>BinaryPath</key>
9+
<string>Python.framework/Python</string>
10+
<key>LibraryIdentifier</key>
11+
<string>tvos-arm64</string>
12+
<key>LibraryPath</key>
13+
<string>Python.framework</string>
14+
<key>SupportedArchitectures</key>
15+
<array>
16+
<string>arm64</string>
17+
</array>
18+
<key>SupportedPlatform</key>
19+
<string>tvos</string>
20+
</dict>
21+
<dict>
22+
<key>BinaryPath</key>
23+
<string>Python.framework/Python</string>
24+
<key>LibraryIdentifier</key>
25+
<string>tvos-arm64_x86_64-simulator</string>
26+
<key>LibraryPath</key>
27+
<string>Python.framework</string>
28+
<key>SupportedArchitectures</key>
29+
<array>
30+
<string>arm64</string>
31+
<string>x86_64</string>
32+
</array>
33+
<key>SupportedPlatform</key>
34+
<string>tvos</string>
35+
<key>SupportedPlatformVariant</key>
36+
<string>simulator</string>
37+
</dict>
38+
</array>
39+
<key>CFBundlePackageType</key>
40+
<string>XFWK</string>
41+
<key>XCFrameworkFormatVersion</key>
42+
<string>1.0</string>
43+
</dict>
44+
</plist>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This directory is intentionally empty.
2+
3+
It is used as a destination for --enable-framework when building for AppleTVOS device, or
4+
it could be utilized by the testbed utility to clone a slice here.
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This directory is intentionally empty.
2+
3+
It is used as a destination for --enable-framework when building for AppleTVOS simulator, or
4+
it could be utilized by the testbed utility to clone a slice here.
5+

0 commit comments

Comments
 (0)