-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·31 lines (26 loc) · 874 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·31 lines (26 loc) · 874 Bytes
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
#!/bin/bash
# WeekCal Test-Script
# Benötigt: Xcode Command Line Tools (xcode-select --install)
# Kompiliert die Kalenderlogik + Tests als ein Modul und führt sie aus.
# Kein XCTest / SPM — eigenes schlankes Assert-Harness, Exit-Code != 0 bei Fehlschlag.
set -euo pipefail
SDK=$(xcrun --sdk macosx --show-sdk-path)
ARCH=$(uname -m) # arm64 oder x86_64
TARGET="${ARCH}-apple-macos12.0"
BIN=$(mktemp -t weekcal-tests)
# CalendarModel.swift gehört zum App-Modul (kein Test-Code in Sources/),
# wird daher zusammen mit der Testdatei als ein Modul kompiliert.
SOURCES=(
Sources/CalendarModel.swift
Tests/CalendarModelTests.swift
)
echo "→ Kompiliere Tests für ${ARCH} (macOS 12+) …"
swiftc \
-sdk "$SDK" \
-target "$TARGET" \
-framework Foundation \
"${SOURCES[@]}" \
-o "$BIN"
echo "→ Führe Tests aus …"
echo ""
"$BIN"