Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: #842 support for test targets flag in multiple testbundles xctest #1219

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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ test_runner/flank/
local.properties
/report.json
results
xcuserdata/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User generated data for iOS projects (breakpoints, interface state etc.)

Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
DEVELOPMENT_TEAM = AD2V26JBWL;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = EarlGreyExampleSwiftTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGreySwiftTests;
PRODUCT_MODULE_NAME = EarlGreyExampleTestsSwift;
Expand All @@ -509,9 +509,9 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = AD2V26JBWL;
DEVELOPMENT_TEAM = L2UF9MLSM6;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GogoApps code signing

INFOPLIST_FILE = EarlGreyExampleSwiftTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGreySwiftTests;
PRODUCT_MODULE_NAME = EarlGreyExampleTestsSwift;
Expand Down Expand Up @@ -559,7 +559,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_MODULE_NAME = EarlGreyExample;
Expand Down Expand Up @@ -600,7 +600,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_MODULE_NAME = EarlGreyExample;
PRODUCT_NAME = EarlGreyExample;
Expand All @@ -622,7 +622,7 @@
DEVELOPMENT_TEAM = AD2V26JBWL;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = "$(SRCROOT)/EarlGreyExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGrey;
PRODUCT_MODULE_NAME = EarlGreyExampleSwift;
Expand All @@ -642,10 +642,10 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = AD2V26JBWL;
DEVELOPMENT_TEAM = L2UF9MLSM6;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = "$(SRCROOT)/EarlGreyExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGrey;
PRODUCT_MODULE_NAME = EarlGreyExampleSwift;
Expand Down Expand Up @@ -680,7 +680,7 @@
$CONFIGURATION_TEMP_DIR/EarlGreyExampleSwift.build/DerivedSources,
);
INFOPLIST_FILE = EarlGreyExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGreyTests;
PRODUCT_MODULE_NAME = EarlGreyExampleTests;
Expand All @@ -704,7 +704,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = NO;
DEVELOPMENT_TEAM = AD2V26JBWL;
DEVELOPMENT_TEAM = L2UF9MLSM6;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
HEADER_SEARCH_PATHS = (
Expand All @@ -714,7 +714,7 @@
$CONFIGURATION_TEMP_DIR/EarlGreyExampleSwift.build/DerivedSources,
);
INFOPLIST_FILE = EarlGreyExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.3;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.gogoapps.earlgrey.samples.EarlGreyTests;
PRODUCT_MODULE_NAME = EarlGreyExampleTests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import EarlGrey
import Foundation

public func GREYAssert(_ expression: @autoclosure () -> Bool, reason: String) {
GREYAssert(expression, reason, details: "Expected expression to be true")
GREYAssert(expression(), reason, details: "Expected expression to be true")
}

public func GREYAssertTrue(_ expression: @autoclosure () -> Bool, reason: String) {
Expand Down
17 changes: 12 additions & 5 deletions test_projects/ios/EarlGreyExample/ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,27 @@ function earl_grey_example() {

local productsDir="$dir/build/Build/Products"

cp -Rf "$productsDir"/*-iphoneos "$FLANK_FIXTURES_TMP/"
# xcodebuild generates .xctestrun files names in format: PROJECTNAME_platform_version_architecture.xctestrun, code below removes "_platform_version_architecture" part
mv -f "$productsDir/EarlGreyExampleSwiftTests"*.xctestrun "$productsDir/EarlGreyExampleSwiftTests.xctestrun"
mv -f "$productsDir/EarlGreyExampleTests"*.xctestrun "$productsDir/EarlGreyExampleTests.xctestrun"

cp "$productsDir"/*.xctestrun "$FLANK_FIXTURES_TMP/"
mkdir -p "$FLANK_FIXTURES_TMP/ios/earl_grey_example/objc/"
mkdir -p "$FLANK_FIXTURES_TMP/ios/earl_grey_example/swift/"

cp -Rf "$productsDir"/*-iphoneos "$FLANK_FIXTURES_TMP/ios/earl_grey_example/"

cp "$productsDir"/*.xctestrun "$FLANK_FIXTURES_TMP/ios/earl_grey_example/"

cp \
"$productsDir/Debug-iphoneos/EarlGreyExampleSwift.app/PlugIns/EarlGreyExampleTests.xctest/EarlGreyExampleTests" \
"$FLANK_FIXTURES_TMP/objc/"
"$FLANK_FIXTURES_TMP/ios/earl_grey_example/objc/"

cp \
"$productsDir/Debug-iphoneos/EarlGreyExampleSwift.app/PlugIns/EarlGreyExampleSwiftTests.xctest/EarlGreyExampleSwiftTests" \
"$FLANK_FIXTURES_TMP/swift/"
"$FLANK_FIXTURES_TMP/ios/earl_grey_example/swift/"
;;

esac done
}

echo "iOS test projects ops loaded"
echo "iOS EarlGreyExample test projects ops loaded"
Loading