Skip to content

Commit

Permalink
Another attempt to fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhowes committed Nov 13, 2024
1 parent 6363847 commit 78ccd5d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ DerivedData/
.DerivedData-iOS/
.DerivedData-macOS/

coverage_*.txt
percentage_*.txt

**/*.old

Gemfile
Expand Down
49 changes: 30 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
PLATFORM_IOS = iOS Simulator,name=iPad mini (A17 Pro)
PLATFORM_MACOS = macOS
XCCOV = xcrun xccov view --report --only-targets

default: build

build-iOS:
rm -rf "$(PWD)/.DerivedData-iOS"
xcodebuild build \
-scheme 'iOS App' \
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)"
default: report

test-iOS:
rm -rf "$(PWD)/.DerivedData-iOS"
xcodebuild test \
-scheme 'iOS App' \
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)"
-destination platform="$(PLATFORM_IOS)" \
-enableCodeCoverage YES

build-macOS:
rm -rf "$(PWD)/.DerivedData-macOS"
xcodebuild build \
-scheme 'macOS App' \
-derivedDataPath "$(PWD)/.DerivedData-macOS" \
-destination platform="$(PLATFORM_MACOS)" \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
coverage-iOS: test-iOS
$(XCCOV) "$(PWD)/.DerivedData-iOS/Logs/Test/Test-iOS App-"*.xcresult > coverage_iOS.txt
echo "iOS Coverage:"
cat coverage_iOS.txt

percentage-iOS: coverage-iOS
awk '/ AUv3-Support / { print $$4 }' coverage_iOS.txt > percentage_iOS.txt
echo "iOS Coverage Pct:"
cat percentage_iOS.txt

test-macOS:
rm -rf "$(PWD)/.DerivedData-macOS"
xcodebuild test \
-scheme 'macOS App' \
-derivedDataPath "$(PWD)/.DerivedData-macOS" \
-destination platform="$(PLATFORM_MACOS)" \
-enableCodeCoverage YES \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

build: test-iOS test-macOS
coverage-macOS: test-macOS
$(XCCOV) "$(PWD)/.DerivedData-macOS/Logs/Test/Test-macOS App-"*.xcresult > coverage_macOS.txt
echo "macOS Coverage:"
cat coverage_macOS.txt

percentage-macOS: coverage-macOS
awk '/ AUv3-Support / { print $$4 }' coverage_macOS.txt > percentage_macOS.txt
echo "macOS Coverage Pct:"
cat percentage_macOS.txt

report: percentage-iOS percentage-macOS
@if [[ -n "$$GITHUB_ENV" ]]; then \
echo "PERCENTAGE=$$(< percentage_macOS.txt)" >> $$GITHUB_ENV; \
fi

.PHONY: build build-iOS test-macOS
.PHONY: report test-iOS test-macOS coverage-iOS coverage-macOS coverage-iOS percentage-macOS percentage-iOS

clean:
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS coverage*.txt percentage*.txt
36 changes: 18 additions & 18 deletions Packages/Tests/KernelTests/KernelTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ - (void)testKernelParams {
AVAudioFormat* format = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:44100.0 channels:2];
kernel->setRenderingFormat(1, format, 100, 20.0);

kernel->setParameterValuePending(ParameterAddressDepth, 10.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressDepth), 10.0, 0.001);
kernel->setParameterValue(ParameterAddressDepth, 10.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressDepth), 10.0, 0.001);

kernel->setParameterValuePending(ParameterAddressDelay, 20.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressDelay), 20.0, 0.001);
kernel->setParameterValue(ParameterAddressDelay, 20.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressDelay), 20.0, 0.001);

kernel->setParameterValuePending(ParameterAddressRate, 30.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressRate), 30.0, 0.001);
kernel->setParameterValue(ParameterAddressRate, 30.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressRate), 30.0, 0.001);

kernel->setParameterValuePending(ParameterAddressFeedback, 40.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressFeedback), 40.0, 0.001);
kernel->setParameterValue(ParameterAddressFeedback, 40.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressFeedback), 40.0, 0.001);

kernel->setParameterValuePending(ParameterAddressDry, 50.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressDry), 50.0, 0.001);
kernel->setParameterValue(ParameterAddressDry, 50.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressDry), 50.0, 0.001);

kernel->setParameterValuePending(ParameterAddressWet, 60.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressWet), 60.0, 0.001);
kernel->setParameterValue(ParameterAddressWet, 60.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressWet), 60.0, 0.001);

XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressNegativeFeedback), 0.0, 0.001);
kernel->setParameterValuePending(ParameterAddressNegativeFeedback, 1.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressNegativeFeedback), 1.0, 0.001);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressNegativeFeedback), 0.0, 0.001);
kernel->setParameterValue(ParameterAddressNegativeFeedback, 1.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressNegativeFeedback), 1.0, 0.001);

XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressOdd90), 0.0, 0.001);
kernel->setParameterValuePending(ParameterAddressOdd90, 1.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValuePending(ParameterAddressOdd90), 1.0, 0.001);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressOdd90), 0.0, 0.001);
kernel->setParameterValue(ParameterAddressOdd90, 1.0);
XCTAssertEqualWithAccuracy(kernel->getParameterValue(ParameterAddressOdd90), 1.0, 0.001);
}

@end

0 comments on commit 78ccd5d

Please sign in to comment.