mirror of
https://github.com/zhigang1992/PerspectiveTransform.git
synced 2026-01-12 17:32:51 +08:00
Merge branch 'swift5'
* swift5: fix: test spec to allow pixel tolerance refactor: Podfile to remove unnecessary inhibit_warnings chore: update pods chore: update podspec dependencies fix: travis snapshot tolerance to 2% use pixel tolerance for snapshot test fix: travis reference images names fix: travis simulator to use latest OS version fix: travis image comparison within a tolerance fix: simulator names fix: travis pod install update reference image fix: travis cocoapods upgrade iPhone simulators update travis to xcode 11.3 fix: snapshot test image use SIMD generics update pods update to xcode recommended settings update cocoapods
This commit is contained in:
@@ -1 +1 @@
|
||||
2.4.5
|
||||
2.6.4
|
||||
|
||||
18
.travis.yml
18
.travis.yml
@@ -1,8 +1,8 @@
|
||||
language: swift
|
||||
osx_image: xcode10.2
|
||||
osx_image: xcode11.3
|
||||
xcode_workspace: Example/PerspectiveTransform.xcworkspace
|
||||
xcode_scheme: Example
|
||||
xcode_sdk: iphonesimulator12.2
|
||||
xcode_sdk: iphonesimulator13.2
|
||||
git:
|
||||
depth: 1 # use 1, as false cause travis lint server 500 exception
|
||||
cache:
|
||||
@@ -25,12 +25,12 @@ matrix:
|
||||
- git diff --exit-code # Outdated Bundle dependencies found, please run 'bundle update' and checkin changes
|
||||
- bundle exec pod lib lint || bundle exec pod lib lint --verbose --no-clean
|
||||
- name: With coverage report
|
||||
env: XCODE_DESNITATION='platform=iOS Simulator,name=iPhone X' CACHE_NAME=iOS
|
||||
env: XCODE_DESTINATION='platform=iOS Simulator,name=iPhone 11 Pro' CACHE_NAME=iOS
|
||||
after_success:
|
||||
- bash <(curl -s 'https://codecov.io/bash') -Z -J '^PerspectiveTransform$' -X gcov -X fix
|
||||
- name: Mac OS
|
||||
xcode_scheme: OpenCV Tests
|
||||
env: XCODE_DESNITATION='platform=macos' CACHE_NAME=macOS
|
||||
env: XCODE_DESTINATION='platform=macos' CACHE_NAME=macOS
|
||||
before_script: ./Example/OpenCV-OSX-Tests/install-opencv.sh
|
||||
cache:
|
||||
bundler: true
|
||||
@@ -93,13 +93,13 @@ matrix:
|
||||
tags: true
|
||||
before_install:
|
||||
- bundle -v || gem install bundler
|
||||
- ls -la Example/Pods/Manifest.lock && echo Skipping cocoapods repo update || git -C ~/.cocoapods/repos/master/ pull --quiet
|
||||
- ls -la Example/Pods/Manifest.lock && echo Skipping cocoapods repo update || pod install --project-directory=Example
|
||||
script:
|
||||
- set -o pipefail && xcodebuild test -workspace "$TRAVIS_XCODE_WORKSPACE" -scheme "$TRAVIS_XCODE_SCHEME" -destination "$XCODE_DESNITATION" | bundle exec xcpretty -f `bundle exec xcpretty-travis-formatter`
|
||||
- set -o pipefail && xcodebuild test -workspace "$TRAVIS_XCODE_WORKSPACE" -scheme "$TRAVIS_XCODE_SCHEME" -destination "$XCODE_DESTINATION" | bundle exec xcpretty -f `bundle exec xcpretty-travis-formatter`
|
||||
env:
|
||||
- XCODE_DESNITATION='platform=iOS Simulator,name=iPhone SE' CACHE_NAME=iOS
|
||||
- XCODE_DESNITATION='platform=iOS Simulator,name=iPhone 8 Plus' CACHE_NAME=iOS
|
||||
- XCODE_DESNITATION='platform=iOS Simulator,name=iPhone 8' CACHE_NAME=iOS
|
||||
- XCODE_DESTINATION='platform=iOS Simulator,name=iPhone 11' CACHE_NAME=iOS
|
||||
- XCODE_DESTINATION='platform=iOS Simulator,name=iPhone 11 Pro Max' CACHE_NAME=iOS
|
||||
- XCODE_DESTINATION='platform=iOS Simulator,name=iPhone 8 Plus' CACHE_NAME=iOS
|
||||
branches:
|
||||
except:
|
||||
- circleci
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1130"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -40,13 +40,22 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES"
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:PerspectiveTransform.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<CodeCoverageTargets>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods/Pods.xcodeproj">
|
||||
@@ -76,17 +85,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:PerspectiveTransform.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -108,8 +106,6 @@
|
||||
ReferencedContainer = "container:PerspectiveTransform.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1130"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -26,13 +26,13 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES"
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES">
|
||||
<CodeCoverageTargets>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods/Pods.xcodeproj">
|
||||
@@ -51,8 +51,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -64,8 +62,6 @@
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
source 'https://cdn.cocoapods.org/'
|
||||
use_frameworks!
|
||||
platform :ios, '12.2'
|
||||
platform :ios, '13.2'
|
||||
|
||||
def DevelopmentPodAndDependencies
|
||||
pod 'PerspectiveTransform', :path => '../'
|
||||
@@ -13,7 +13,7 @@ target 'Example' do
|
||||
DevelopmentPodAndDependencies()
|
||||
|
||||
def SwiftTestingPods
|
||||
pod 'Quick', :inhibit_warnings => true
|
||||
pod 'Quick'
|
||||
pod 'Nimble'
|
||||
end
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
PODS:
|
||||
- ImageCoordinateSpace (1.1)
|
||||
- iOSSnapshotTestCase (6.1.0):
|
||||
- iOSSnapshotTestCase/SwiftSupport (= 6.1.0)
|
||||
- iOSSnapshotTestCase/Core (6.1.0)
|
||||
- iOSSnapshotTestCase/SwiftSupport (6.1.0):
|
||||
- iOSSnapshotTestCase (6.2.0):
|
||||
- iOSSnapshotTestCase/SwiftSupport (= 6.2.0)
|
||||
- iOSSnapshotTestCase/Core (6.2.0)
|
||||
- iOSSnapshotTestCase/SwiftSupport (6.2.0):
|
||||
- iOSSnapshotTestCase/Core
|
||||
- Nimble (8.0.2)
|
||||
- Nimble-Snapshots (8.0.0):
|
||||
- Nimble-Snapshots/Core (= 8.0.0)
|
||||
- Nimble-Snapshots/Core (8.0.0):
|
||||
- Nimble (8.0.5)
|
||||
- Nimble-Snapshots (8.1.0):
|
||||
- Nimble-Snapshots/Core (= 8.1.0)
|
||||
- Nimble-Snapshots/Core (8.1.0):
|
||||
- iOSSnapshotTestCase (~> 6.0)
|
||||
- Nimble (~> 8.0)
|
||||
- PerspectiveTransform (1.0)
|
||||
- Quick (2.1.0)
|
||||
- Quick (2.2.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- ImageCoordinateSpace
|
||||
@@ -22,7 +22,7 @@ DEPENDENCIES:
|
||||
- Quick
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/CocoaPods/Specs.git:
|
||||
trunk:
|
||||
- ImageCoordinateSpace
|
||||
- iOSSnapshotTestCase
|
||||
- Nimble
|
||||
@@ -35,12 +35,12 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
ImageCoordinateSpace: 9e560a43a97375371f22343bb47e2c7e7fc428ae
|
||||
iOSSnapshotTestCase: 30d540b0c8feb9d7f8ff97acc25a3804b48ee264
|
||||
Nimble: 622629381bda1dd5678162f21f1368cec7cbba60
|
||||
Nimble-Snapshots: 8ec63f41ce6c7229a17be9a64edbc123b181f75b
|
||||
PerspectiveTransform: 77d4f6b4ef5b8dbf5472afb8864ee3a74fffa193
|
||||
Quick: 4be43f6634acfa727dd106bdf3929ce125ffa79d
|
||||
iOSSnapshotTestCase: 9ab44cb5aa62b84d31847f40680112e15ec579a6
|
||||
Nimble: 4ab1aeb9b45553c75b9687196b0fa0713170a332
|
||||
Nimble-Snapshots: 3a624ceb92ec1f110da64933d1536199910e885a
|
||||
PerspectiveTransform: 03b9bc0a363917602cd660d7d8fe031f549c73d3
|
||||
Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e
|
||||
|
||||
PODFILE CHECKSUM: 80ff60e539c07a49578d282438bd9e678f55ceff
|
||||
PODFILE CHECKSUM: 1022d64c64e11ea237eb8911f12da68da807a763
|
||||
|
||||
COCOAPODS: 1.8.0.beta.1
|
||||
COCOAPODS: 1.8.4
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
LastUpgradeVersion = "1130"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -14,7 +14,7 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
@@ -26,13 +26,22 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES"
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
onlyGenerateCoverageForSpecifiedTargets = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<CodeCoverageTargets>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
@@ -51,17 +60,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -76,14 +74,12 @@
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
@@ -94,7 +90,7 @@
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "A8E8CD82C2B65E5DF42B579E9F963CF7"
|
||||
BlueprintIdentifier = "444140A8BC05DE31BDA82ECC1288CFC5"
|
||||
BuildableName = "PerspectiveTransform.framework"
|
||||
BlueprintName = "PerspectiveTransform"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
|
||||
@@ -10,7 +10,7 @@ class CALayerTransformSpec: QuickSpec {
|
||||
it("should have x,y,z") {
|
||||
let transform = CATransform3DMakeTranslation(1, 2, 3)
|
||||
|
||||
var translate = transform.component(for: .translation)
|
||||
let translate = transform.component(for: .translation)
|
||||
|
||||
expect(translate.x) == 1
|
||||
expect(translate.y) == 2
|
||||
@@ -22,7 +22,7 @@ class CALayerTransformSpec: QuickSpec {
|
||||
context("around one axis") {
|
||||
it("should match rotation.x component") {
|
||||
let transform = CATransform3DMakeRotation(0.1234, 1, 0, 0)
|
||||
var rotate = transform.component(for: .rotation)
|
||||
let rotate = transform.component(for: .rotation)
|
||||
|
||||
expect(rotate.x) == 0.1234
|
||||
expect(rotate.y) == 0
|
||||
@@ -42,7 +42,7 @@ class CALayerTransformSpec: QuickSpec {
|
||||
context("large angles") {
|
||||
it("should be wrapped by asin") {
|
||||
let transform = CATransform3DMakeRotation(100, 1, 0, 0)
|
||||
var rotate = transform.layerRotation()
|
||||
let rotate = transform.layerRotation()
|
||||
|
||||
expect(rotate.x) == asin(sin(100))
|
||||
expect(rotate.y) == 0
|
||||
|
||||
@@ -12,7 +12,7 @@ import simd
|
||||
|
||||
class CATransform3DMatrixPerformanceTest: XCTestCase {
|
||||
let m4x4 = double4x4((1...4).map { row in
|
||||
double4((1...4).map {Double(10 * row + $0)})
|
||||
SIMD4<Double>((1...4).map {Double(10 * row + $0)})
|
||||
})
|
||||
let iterations = 100000
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ class CATransform3D_MatrixSpec: QuickSpec {
|
||||
var m4x4: double4x4!
|
||||
|
||||
beforeEach {
|
||||
let columns: [double4] = (1...4).map { row in
|
||||
double4((1...4).map {Double(10 * row + $0)})
|
||||
let columns: [SIMD4<Double>] = (1...4).map { row in
|
||||
SIMD4<Double>((1...4).map {Double(10 * row + $0)})
|
||||
}
|
||||
m4x4 = double4x4(columns)
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ class CATransform3Dfrom2DSpec: QuickSpec {
|
||||
context("layer") {
|
||||
it("should have components") {
|
||||
let transform = CATransform3D(matrix.to3d())
|
||||
var scale = transform.component(for: .scale)
|
||||
let scale = transform.component(for: .scale)
|
||||
let madeScale = CATransform3DMakeScale(CGFloat(scale.x), CGFloat(scale.y), CGFloat(scale.z))
|
||||
print("madeScale:", madeScale)
|
||||
|
||||
var translate = transform.component(for: .translation)
|
||||
let translate = transform.component(for: .translation)
|
||||
let madeTranslation = CATransform3DMakeTranslation(CGFloat(translate.x), CGFloat(translate.y), CGFloat(translate.z))
|
||||
print("madeTranslation:", madeTranslation)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ class MatrixSpec: QuickSpec {
|
||||
describe("matrix") {
|
||||
|
||||
let m = float2x2(rows: [
|
||||
float2( 4, 3),
|
||||
float2( 3, 2)
|
||||
SIMD2<Float>( 4, 3),
|
||||
SIMD2<Float>( 3, 2)
|
||||
])
|
||||
|
||||
context("inverse") {
|
||||
@@ -18,8 +18,8 @@ class MatrixSpec: QuickSpec {
|
||||
it("should match expected") {
|
||||
// http://www.mathwords.com/i/inverse_of_a_matrix.htm
|
||||
let expectInvert = float2x2(rows: [
|
||||
float2( -2, 3),
|
||||
float2( 3, -4)
|
||||
SIMD2<Float>( -2, 3),
|
||||
SIMD2<Float>( 3, -4)
|
||||
])
|
||||
expect(inverse) == expectInvert
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class MatrixSpec: QuickSpec {
|
||||
// | 1 2 |
|
||||
// | | = 1*4-2*3 = -2
|
||||
// | 3 4 |
|
||||
expect(float2x2([float2(1, 2), float2(3, 4)]).determinant) == -2
|
||||
expect(float2x2([SIMD2<Float>(1, 2), SIMD2<Float>(3, 4)]).determinant) == -2
|
||||
}
|
||||
|
||||
it("should match math word 3x3 example") {
|
||||
|
||||
@@ -73,7 +73,7 @@ class ProjectionSpec: QuickSpec {
|
||||
var to: Perspective!
|
||||
|
||||
beforeEach {
|
||||
var points = Quadrilateral(CGRect(origin: CGPoint.zero, size: CGSize(width: 10, height: 10))).corners
|
||||
let points = Quadrilateral(CGRect(origin: CGPoint.zero, size: CGSize(width: 10, height: 10))).corners
|
||||
from = Perspective(points)
|
||||
let turnedRight = [points[1], points[3], points[0], points[2]]
|
||||
to = Perspective(turnedRight)
|
||||
|
||||
@@ -111,7 +111,7 @@ enum TransformComponent: String {
|
||||
extension CALayer {
|
||||
func transformComponent(_ component: TransformComponent) -> Vector3 {
|
||||
var vector = Vector3()
|
||||
let keyPathMap: [WritableKeyPath<Vector3, Double>:String] = [
|
||||
let keyPathMap: [WritableKeyPath<Vector3, Double>: String] = [
|
||||
\.x: "x",
|
||||
\.y: "y",
|
||||
\.z: "z"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 908 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 902 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
@@ -6,8 +6,6 @@ import Foundation
|
||||
|
||||
class SnapshotSpec: QuickSpec {
|
||||
override func spec() {
|
||||
let runningOnIphone5s = ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] == "iPhone 5s"
|
||||
|
||||
describe("overlay placement") {
|
||||
var containerView: UIView!
|
||||
var overlayView: UIView!
|
||||
@@ -39,17 +37,14 @@ class SnapshotSpec: QuickSpec {
|
||||
overlayView.layer.transform = start.projectiveTransform(destination: destination)
|
||||
}
|
||||
|
||||
it("should look as expected") {
|
||||
var tolerance: CGFloat = 0
|
||||
it("should look as expected within a tolerance") {
|
||||
let tolerance: CGFloat = 0.02
|
||||
let toleranceMessage = {"\(100 * tolerance)% tolerance"}
|
||||
if runningOnIphone5s {
|
||||
// For some unknown reason there is a 30% difference in image when running on Travis CI
|
||||
// TODO: use pixel difference tolerance instead of image percent tolerance when it becomes available
|
||||
// see https://github.com/uber/ios-snapshot-test-case/blob/master/CHANGELOG.md#502
|
||||
tolerance = 0.3
|
||||
fputs("images compared on iPhone 5s with \(toleranceMessage())\n".uppercased(), __stderrp)
|
||||
}
|
||||
expect(containerView).to(haveValidSnapshot(usesDrawRect: true, tolerance: tolerance), description: "should match with \(toleranceMessage())")
|
||||
fputs("images are compared with \(toleranceMessage())\n".uppercased(), __stderrp)
|
||||
expect(containerView).to(haveValidSnapshot(usesDrawRect: true,
|
||||
pixelTolerance: tolerance,
|
||||
tolerance: tolerance),
|
||||
description: "should match with \(toleranceMessage())")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
Gemfile.lock
33
Gemfile.lock
@@ -1,29 +1,29 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.1)
|
||||
CFPropertyList (3.0.2)
|
||||
activesupport (4.2.11.1)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
algoliasearch (1.26.1)
|
||||
algoliasearch (1.27.1)
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
backports (3.15.0)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.8.0.beta.1)
|
||||
cocoapods (1.8.4)
|
||||
activesupport (>= 4.0.2, < 5)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.8.0.beta.1)
|
||||
cocoapods-core (= 1.8.4)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.2.2, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
cocoapods-search (>= 1.0.0, < 2.0)
|
||||
cocoapods-stats (>= 1.0.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.3.1, < 2.0)
|
||||
cocoapods-trunk (>= 1.4.0, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
@@ -33,18 +33,19 @@ GEM
|
||||
nap (~> 1.0)
|
||||
ruby-macho (~> 1.4)
|
||||
xcodeproj (>= 1.11.1, < 2.0)
|
||||
cocoapods-core (1.8.0.beta.1)
|
||||
cocoapods-core (1.8.4)
|
||||
activesupport (>= 4.0.2, < 6)
|
||||
algoliasearch (~> 1.0)
|
||||
concurrent-ruby (~> 1.1)
|
||||
fuzzy_match (~> 2.0.4)
|
||||
nap (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.4)
|
||||
cocoapods-downloader (1.2.2)
|
||||
cocoapods-downloader (1.3.0)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.0)
|
||||
cocoapods-stats (1.1.0)
|
||||
cocoapods-trunk (1.4.0)
|
||||
cocoapods-trunk (1.4.1)
|
||||
nap (>= 0.8, < 2.0)
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.1.0)
|
||||
@@ -53,11 +54,11 @@ GEM
|
||||
escape (0.0.4)
|
||||
ethon (0.12.0)
|
||||
ffi (>= 1.3.0)
|
||||
faraday (0.15.4)
|
||||
faraday (0.17.3)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday_middleware (0.13.1)
|
||||
faraday (>= 0.7.4, < 1.0)
|
||||
ffi (1.11.1)
|
||||
ffi (1.11.3)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh (0.15.1)
|
||||
@@ -72,12 +73,12 @@ GEM
|
||||
httpclient (2.8.3)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.2.0)
|
||||
json (2.3.0)
|
||||
launchy (2.4.3)
|
||||
addressable (~> 2.3)
|
||||
minitest (5.11.3)
|
||||
minitest (5.13.0)
|
||||
molinillo (0.6.6)
|
||||
multi_json (1.13.1)
|
||||
multi_json (1.14.1)
|
||||
multipart-post (2.1.1)
|
||||
nanaimo (0.2.6)
|
||||
nap (1.1.0)
|
||||
@@ -101,10 +102,10 @@ GEM
|
||||
typhoeus (~> 0.6, >= 0.6.8)
|
||||
typhoeus (0.8.0)
|
||||
ethon (>= 0.8.0)
|
||||
tzinfo (1.2.5)
|
||||
tzinfo (1.2.6)
|
||||
thread_safe (~> 0.1)
|
||||
websocket (1.2.8)
|
||||
xcodeproj (1.12.0)
|
||||
xcodeproj (1.14.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
@@ -125,4 +126,4 @@ DEPENDENCIES
|
||||
xcpretty-travis-formatter
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.1
|
||||
2.1.2
|
||||
|
||||
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
|
||||
ts.requires_app_host = false
|
||||
ts.source_files = 'Example/Specs/**/*.{h,swift}', 'Example/Tests/*Helper.swift'
|
||||
ts.dependencies = {
|
||||
'Quick' => '~> 2.0',
|
||||
'Quick' => '~> 2.2',
|
||||
'Nimble' => '~> 8.0'
|
||||
}
|
||||
end
|
||||
@@ -31,9 +31,8 @@ Pod::Spec.new do |s|
|
||||
ts.resources = 'Example/Tests/**/*.{png,jpg,svg}'
|
||||
ts.source_files = 'Example/Tests/**/*.{h,swift}', 'Example/PerspectiveTransform/resetAnchorPoint.swift'
|
||||
ts.dependencies = {
|
||||
'Quick' => '~> 2.0',
|
||||
'Nimble-Snapshots' => '~> 7.0',
|
||||
'iOSSnapshotTestCase' => '~> 6.0'
|
||||
'Quick' => '~> 2.2',
|
||||
'Nimble-Snapshots' => '~> 8.1'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
import simd
|
||||
|
||||
typealias Scalar = Double
|
||||
typealias Vector3 = double3
|
||||
typealias Vector3 = SIMD3<Double>
|
||||
typealias Matrix3x3 = double3x3
|
||||
typealias Matrix4x4 = double4x4
|
||||
|
||||
Reference in New Issue
Block a user