Skip to content

Commit

Permalink
Try test target configuration for warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brittlewis12 committed Oct 14, 2024
1 parent c45a38c commit 70a5b0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftRustIntegrationTestRunner.app/Contents/MacOS/SwiftRustIntegrationTestRunner";
};
Expand All @@ -677,6 +678,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftRustIntegrationTestRunner.app/Contents/MacOS/SwiftRustIntegrationTestRunner";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class ResultTests: XCTestCase {

/// Verify that we can receive a Result<UnitStruct, OpaqueRust> from Rust
func testSwiftCallRustResultUnitStructOpaqueRust() throws {
try! rust_func_return_result_unit_struct_opaque_rust(true)
_ = try! rust_func_return_result_unit_struct_opaque_rust(true)

do {
try rust_func_return_result_unit_struct_opaque_rust(false)
_ = try rust_func_return_result_unit_struct_opaque_rust(false)
XCTFail("The function should have returned an error.")
} catch let error as ResultTestOpaqueRustType {
XCTAssertEqual(error.val(), 222)
Expand Down

0 comments on commit 70a5b0e

Please sign in to comment.