[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',
os.path.join(CODETOANALYZE_DIR, 'componentkit'),
[{'compile': ['clang', '-x', 'objective-c++', '-std=c++11', '-c',
'TestIgnoreImports.mm'],
'-fblocks', 'TestIgnoreImports.mm'],
'infer_args': ['--cxx', '--no-filtering', '-a', 'linters']}])
def test_fail_on_issue(self):

@ -9,23 +9,7 @@
#include "HeaderWithMutableLocalVar.h"
#define nil 0
// 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
#include "../../../codetoanalyze/objcpp/linters/componentkit/FakeComponentKitHeader.h"
@interface SomeClass : CKCompositeComponent
@end

@ -7,7 +7,22 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifdef __APPLE__
#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
@interface CKComponent : NSObject

Loading…
Cancel
Save