[componentkit] Reference fake header in build system test

Reviewed By: dulmarod

Differential Revision: D4033937

fbshipit-source-id: adccbd6
master
Ryan Rhee 8 years ago committed by Facebook Github Bot
parent 25a688bdbe
commit a4501462cc

@ -498,7 +498,7 @@ class BuildIntegrationTest(unittest.TestCase):
test('componentkit', 'component quality analyzer skips imports', test('componentkit', 'component quality analyzer skips imports',
os.path.join(CODETOANALYZE_DIR, 'componentkit'), os.path.join(CODETOANALYZE_DIR, 'componentkit'),
[{'compile': ['clang', '-x', 'objective-c++', '-std=c++11', '-c', [{'compile': ['clang', '-x', 'objective-c++', '-std=c++11', '-c',
'TestIgnoreImports.mm'], '-fblocks', 'TestIgnoreImports.mm'],
'infer_args': ['--cxx', '--no-filtering', '-a', 'linters']}]) 'infer_args': ['--cxx', '--no-filtering', '-a', 'linters']}])
def test_fail_on_issue(self): def test_fail_on_issue(self):

@ -9,23 +9,7 @@
#include "HeaderWithMutableLocalVar.h" #include "HeaderWithMutableLocalVar.h"
#define nil 0 #include "../../../codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h"
// Mimic importing CKComponnet
@interface CKComponent
@end
@implementation CKComponent
@end
// Mimic importing CKCompositeComponnet
@interface CKCompositeComponent : CKComponent
+ (instancetype)newWithComponent:(CKComponent*)component;
@end
@implementation CKCompositeComponent
+ (instancetype)newWithComponent:(CKComponent*)component {
return nil;
}
@end
@interface SomeClass : CKCompositeComponent @interface SomeClass : CKCompositeComponent
@end @end

@ -7,7 +7,22 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
#ifdef __APPLE__
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#elif __linux__
// fake foundation enough so linux doesn't complain
#define nil 0
@interface NSObject
@end
@implementation NSObject
@end
@interface NSString : NSObject
@end
@implementation NSString
@end
#else
#error "Need either os x or linux"
#endif
// Mimic importing CKComponnet // Mimic importing CKComponnet
@interface CKComponent : NSObject @interface CKComponent : NSObject

Loading…
Cancel
Save