-
Download OS from AppStore (eg macOS Sonoma) -- do not install
-
Open terminal to get shell prompt. Go to desktop:
% cd ~/Desktop
- Create DMG container (note 1 hyphen in "-volume" and other args)
{"label":"Coverage","message":"12.34%","schemaVersion":1,"color":"success"} |
Download OS from AppStore (eg macOS Sonoma) -- do not install
Open terminal to get shell prompt. Go to desktop:
% cd ~/Desktop
msmtp
using brew install msmtp
msmtp
using the following:# Set default values for all the accounts.
defaults
auth on
logfile ~/.maildir/msmtp.log
port 587
protocol smtp
{"label":"Coverage","message":"86.01%","schemaVersion":1,"color":"success"} |
# XCode scheme to build and test | |
SCHEME = Searching | |
# The sim to use when running tests | |
PLATFORM_IOS = iOS Simulator,name=iPhone SE (3rd generation) | |
# Coomand line options for xcodebuild that incorporate the above values | |
DEST = -project Searching.xcodeproj -scheme "$(SCHEME)" -destination platform="$(PLATFORM_IOS)" | |
# The pattern to use when matching lines from xcov output. The coverage total will be the average |
#!/usr/bin/env python | |
import concurrent.futures | |
from dataclasses import dataclass | |
from github import Github | |
from termcolor import colored | |
from functools import partial | |
@dataclass |
// When working properly, SWIFTPM_MODULE_BUNDLE is defined. At least on Xcode 13.2, this is not always the case with | |
// packages, especially when running tests. The code below was pulled from my SF2Lib Swift package. This package is | |
// used in my SoundFonts application. The workaround below handles two situations where SWIFTPM_MODULE_BUNDLE is not | |
// working right: | |
// | |
// 1. SWIFTPM_MODULE_BUNDLE not defined -- seems to be limited to unit tests in the SF2Lib package | |
// 2. SWIFTPM_MODULE_BUNDLE defined but throws exception -- seems to be limited to unit tests of a package that depends | |
// on SF2Lib package | |
// |
#!/bin/bash | |
set -eu | |
echo "-- BEGIN post-build.sh" | |
function process # TOP EMBED | |
{ | |
local TOP="${1}" EMBED="${2}" | |
cd "${CODESIGNING_FOLDER_PATH}/${TOP}" |
swift build
swift test --enable-code-coverage
For step #4, we need to do some sleuthing and digging around into artifacts created by the Swift toolchain. First, we need to find the location of the XCTest bundle that step #3 generated and save it in an environment variable:
import Parsing | |
import XCTest | |
import Foundation | |
#if canImport(Darwin) | |
import Darwin.C | |
#elseif canImport(Glibc) | |
import Glibc | |
#endif |