Using the new ObjC type analyzer API, scan the bound packages for references to ObjC classes and protocols and generate Go wrappers for them. This is the second part of the implementation of proposal golang/go#17102. For golang/go#17102 Change-Id: I773db7b0362a7ff526d0a0fd6da5b2fa33301144 Reviewed-on: https://go-review.googlesource.com/29174 Reviewed-by: David Crawshaw <crawshaw@golang.org>
63 lines
1.0 KiB
Objective-C
63 lines
1.0 KiB
Objective-C
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build ignore
|
|
|
|
@import ObjectiveC.message;
|
|
@import Foundation;
|
|
@import XCTest;
|
|
@import Objcpkg;
|
|
|
|
@interface TestNSObject : NSObject
|
|
|
|
- (NSString *)description;
|
|
- (NSString *)super_description;
|
|
|
|
@end
|
|
|
|
@implementation TestNSObject
|
|
|
|
- (NSString *)description {
|
|
return @"hej";
|
|
}
|
|
|
|
- (NSString *)super_description {
|
|
return [super description];
|
|
}
|
|
|
|
@end
|
|
|
|
@interface wrappers : XCTestCase
|
|
|
|
@end
|
|
|
|
@implementation wrappers
|
|
|
|
- (void)setUp {
|
|
[super setUp];
|
|
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
}
|
|
|
|
- (void)tearDown {
|
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
[super tearDown];
|
|
}
|
|
|
|
- (void)testFunction {
|
|
GoObjcpkgFunc();
|
|
}
|
|
|
|
- (void)testMethod {
|
|
GoObjcpkgMethod();
|
|
}
|
|
|
|
- (void)testNew {
|
|
GoObjcpkgNew();
|
|
}
|
|
|
|
- (void)testError {
|
|
GoObjcpkgError();
|
|
}
|
|
@end
|