Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/verify-distribution-notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import plistlib

ROOT = Path(__file__).resolve().parents[1]
NOTICES = ('CREDITS.md', 'LICENSES/README.md', 'LICENSES/MIT-trevlars.txt', 'LICENSES/SDL-zlib.txt')
NOTICES = ('CREDITS.md', 'LICENSES/MIT-trevlars.txt', 'LICENSES/SDL-zlib.txt')


def verify(app, emulator, root=ROOT):
Expand Down
2 changes: 0 additions & 2 deletions tests/app-identity/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
root = Path(__file__).resolve().parents[2]
info = plistlib.loads((root / 'Resources/Info.plist').read_bytes())
assert info['CFBundleIdentifier'] == 'wabisabi.ware.gamecubed'
assert info['CFBundleDisplayName'] == 'Switch2Kit'
assert info['CFBundleName'] == 'Switch2Kit'
assert info['CFBundleExecutable'] == 'Switch2KitApp'
assert 'Peter Sharma' in info['NSHumanReadableCopyright']
# Automatic installation is removed, not merely disabled by a preference.
Expand Down
10 changes: 0 additions & 10 deletions tests/distribution-notices/test_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,6 @@ def test_packagers_copy_notices_before_signing_or_archiving(self):
self.assertNotIn('COMMAND codesign', bundle)
self.assertIn('verify-distribution-notices.py', (ROOT / 'scripts/build-switch2kit-emulator.sh').read_text())

def test_notice_index_links_sources_and_retained_texts(self):
text = (ROOT / 'LICENSES/README.md').read_text()
self.assertIn('https://github.com/Peterksharma/switch2mac/tree/', text)
self.assertIn('[CREDITS.md](../CREDITS.md)', text)
for name in ('MIT-trevlars.txt', 'SDL-zlib.txt'):
self.assertIn('(' + name + ')', text)
self.assertIn('modified, unofficial SDL sources', text)
self.assertIn('Permission is hereby granted', (ROOT / 'LICENSES/MIT-trevlars.txt').read_text())
self.assertIn('This notice may not be removed', (ROOT / 'LICENSES/SDL-zlib.txt').read_text())


if __name__ == '__main__':
unittest.main()
5 changes: 1 addition & 4 deletions tests/output-health/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ assert '.disabled(!status.model.capabilities.contains(.rumble))' in dashboard
assert 'engine.testRumble(serial: serial)' in dashboard
assert 'engine.testRumble(serial: controller.serial)' in view
assert 'engine.testRumble(player:' not in dashboard + view
assert 'No matching connected controller' in view
assert 'Test preset' in dashboard and 'Rumble is muted.' in dashboard
assert 'id: "output-status"' in app
assert 'Output Status and Capabilities' in app and 'Output Status and Capabilities' in view
assert '.disabled(controller == nil || !OutputCapabilities(model: model, backend: backend).directRumble)' in view
for sink in ('UDPHub','WebSocketHub','NetworkGamepadSink','VirtualHIDSink'):
assert f'OutputStatusStore.shared.register({sink}())' in app
print('PASS output UI wiring, serial-addressed rumble tests, mute and preset guidance')
print('PASS output UI wiring, serial-addressed rumble tests and capability guards')
PY

# Exercise real production sinks, sharing only existing harness declarations.
Expand Down
17 changes: 2 additions & 15 deletions tests/repository/test_layout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Repository layout, documentation links, and application identity."""
"""Repository integrity, documentation links, and executable identity."""
from pathlib import Path
import json
import plistlib
import re
import subprocess
Expand All @@ -12,22 +11,11 @@
class RepositoryTests(unittest.TestCase):
def test_application_identity(self):
info = plistlib.loads((ROOT / "Resources/Info.plist").read_bytes())
self.assertEqual(info["CFBundleName"], "Switch2Kit")
self.assertEqual(info["CFBundleDisplayName"], "Switch2Kit")
self.assertEqual(info["CFBundleExecutable"], "Switch2KitApp")
self.assertEqual(info["CFBundleIdentifier"], "wabisabi.ware.gamecubed")
self.assertTrue((ROOT / "Sources/Switch2KitApp/Switch2KitApp.swift").is_file())
self.assertIn('name: "Switch2KitApp"', (ROOT / "Package.swift").read_text())
self.assertIn('APP_NAME="Switch2Kit"', (ROOT / "scripts/build-app.sh").read_text())
self.assertIn('EXE=Switch2KitApp', (ROOT / "scripts/build-app.sh").read_text())

def test_browser_identity(self):
manifest = json.loads((ROOT / "browser/extension/manifest.json").read_text())
self.assertTrue(manifest["name"].startswith("Switch2Kit"))
self.assertIn("Switch2Kit", manifest["description"])

def test_documentation_links(self):
roots = [ROOT / "docs", ROOT / "Examples", ROOT / "sdl", ROOT / "browser"]
roots = [ROOT / "docs", ROOT / "Examples", ROOT / "sdl", ROOT / "browser", ROOT / "LICENSES"]
files = [ROOT / "README.md", ROOT / "CREDITS.md"]
for root in roots:
files.extend(root.rglob("*.md"))
Expand All @@ -53,7 +41,6 @@ def test_source_only_tree(self):
tracked = subprocess.check_output(["git", "ls-files", "-z"], cwd=ROOT).decode().split("\0")
for path in filter(None, tracked):
self.assertFalse(path.endswith((".dylib", ".xcframework.zip")), path)
self.assertLess(len((ROOT / "README.md").read_text().splitlines()), 100)

if __name__ == "__main__":
unittest.main()
Loading