[tests] Convert objective-c frontend tests to new direct format

Reviewed By: jberdine

Differential Revision: D3886011

fbshipit-source-id: 2e0c014
master
Cristiano Calcagno 8 years ago committed by Facebook Github Bot 5
parent 95f6639d6d
commit c134eac91e

@ -1,14 +1,6 @@
[alias]
endtoend_test_objc = //infer/tests/endtoend:objc_endtoend_tests
frontend_test_objc = //infer/tests/frontend:objc_frontend_tests
integration_tests = //infer/tests:integration_tests
objc = //infer/tests:objc_tests
objcpp = //infer/tests:objcpp_tests
clang = //infer/tests:clang_tests
java = //infer/tests/endtoend:java_endtoend_tests
java_libraries = //dependencies/java:java_libraries
# TODO: this line exists only to support buck integration in infer/tests/build_systems/build_integration_tests.py

@ -18,8 +18,7 @@ TARGETS_TO_TEST += java
DIRECT_TESTS += java_checkers_test java_eradicate_test java_infer_test java_tracing_test java_quandary_test
endif
ifneq ($(XCODE_SELECT),no)
TARGETS_TO_TEST += objc objcpp
DIRECT_TESTS += objc_infer_test objc_linters objcpp_linters
DIRECT_TESTS += objc_frontend_test objc_infer_test objc_linters objcpp_frontend_test objcpp_linters
endif
TARGETS_TO_TEST := $(shell echo $(TARGETS_TO_TEST))
@ -98,7 +97,7 @@ endif
ocaml_unit_test: test_this_build
$(TEST_BUILD_DIR)/unit/inferunit.byte
frontend_replace: c_frontend_replace cpp_frontend_replace
frontend_replace: c_frontend_replace cpp_frontend_replace objc_frontend_replace objcpp_frontend_replace
c_frontend_replace:
make -C ./infer/tests/codetoanalyze/c/frontend replace
@ -133,23 +132,38 @@ java_tracing_test:
java_quandary_test:
make -C ./infer/tests/codetoanalyze/java/quandary test
objc_frontend_replace:
make -C ./infer/tests/codetoanalyze/objc/frontend replace
objc_frontend_test:
make -C ./infer/tests/codetoanalyze/objc/frontend test
objc_infer_test:
make -C ./infer/tests/codetoanalyze/objc/errors test
objc_linters:
make -C ./infer/tests/codetoanalyze/objc/linters test
objcpp_frontend_replace:
make -C ./infer/tests/codetoanalyze/objcpp/frontend replace
objcpp_frontend_test:
make -C ./infer/tests/codetoanalyze/objcpp/frontend test
objcpp_linters:
make -C ./infer/tests/codetoanalyze/objcpp/linters test
buck_test: infer
direct_tests:
make $(DIRECT_TESTS)
buck_test: infer
make direct_tests
NO_BUCKD=1 buck clean
MAKEFLAGS= NO_BUCKD=1 buck test -j $(NCPU) -L $(NCPU) $(TARGETS_TO_TEST)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py
buck_test_xml: infer
make $(DIRECT_TESTS)
make direct_tests
NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test -j $(NCPU) -L $(NCPU) --xml test.xml $(TARGETS_TO_TEST)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py

@ -1,22 +0,0 @@
java_test(
name='objc_tests',
deps=[
'//infer/tests/frontend:objc_frontend_tests',
],
)
java_test(
name='objcpp_tests',
deps=[
'//infer/tests/endtoend:objcpp_endtoend_tests',
'//infer/tests/frontend:objcpp_frontend_tests',
],
)
java_test(
name='clang_tests',
deps=[
'//infer/tests:objc_tests',
'//infer/tests:objcpp_tests',
],
)

@ -24,4 +24,4 @@ replace: capture
make clean
clean:
rm -rf infer-out *.o */*.test.dot
rm -rf infer-out *.o */*.test.dot */*/*.test.dot

@ -11,8 +11,9 @@ IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/
XCODEROOT = $(shell xcode-select -p)
OPTIONS = -x objective-c -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c
OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
FILES = \

@ -1,5 +1,12 @@
/* @generated */
digraph iCFG {
37 [label="37: Exit frontend_checks_10391c9ce4c9dbd06a97986e9fc1220c \n " color=yellow style=filled]
36 [label="36: Start frontend_checks_10391c9ce4c9dbd06a97986e9fc1220c\nFormals: \nLocals: \n " color=yellow style=filled]
36 -> 37 ;
35 [label="35: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class NSAutoreleasePool ):unsigned long ) [line 60]\n n$5=_fun_NSObject_init(n$4:class NSAutoreleasePool *) virtual [line 60]\n *&pool:class NSAutoreleasePool *=n$5 [line 60]\n " shape="box"]

@ -1,131 +0,0 @@
digraph iCFG {
721 [label="721: BinaryOperatorStmt: Assign \n n$648=*&self:class NullDeref * [line 8]\n n$649=*&attachmentContainerView:class UIView * [line 8]\n *n$648.NullDeref__attachmentContainerView:class NullDeref *=n$649 [line 8]\n REMOVE_TEMPS(n$648,n$649); [line 8]\n NULLIFY(&attachmentContainerView,false); [line 8]\n NULLIFY(&self,false); [line 8]\n APPLY_ABSTRACTION; [line 8]\n " shape="box"]
721 -> 720 ;
720 [label="720: Exit NullDeref_setAttachmentContainerView: \n " color=yellow style=filled]
719 [label="719: Start NullDeref_setAttachmentContainerView:\nFormals: self:class NullDeref * attachmentContainerView:class UIView *\nLocals: \n DECLARE_LOCALS(&return); [line 8]\n " color=yellow style=filled]
719 -> 721 ;
718 [label="718: Return Stmt \n n$646=*&self:class NullDeref * [line 8]\n n$647=*n$646.NullDeref__attachmentContainerView:class UIView * [line 8]\n *&return:class UIView *=n$647 [line 8]\n REMOVE_TEMPS(n$646,n$647); [line 8]\n NULLIFY(&self,false); [line 8]\n APPLY_ABSTRACTION; [line 8]\n " shape="box"]
718 -> 717 ;
717 [label="717: Exit NullDeref_attachmentContainerView \n " color=yellow style=filled]
716 [label="716: Start NullDeref_attachmentContainerView\nFormals: self:class NullDeref *\nLocals: \n DECLARE_LOCALS(&return); [line 8]\n " color=yellow style=filled]
716 -> 718 ;
715 [label="715: BinaryOperatorStmt: Assign \n n$644=*&self:class NullDeref * [line 7]\n n$645=*&backgroundCoveringView:class UIView * [line 7]\n *n$644.NullDeref__backgroundCoveringView:class NullDeref *=n$645 [line 7]\n REMOVE_TEMPS(n$644,n$645); [line 7]\n NULLIFY(&backgroundCoveringView,false); [line 7]\n NULLIFY(&self,false); [line 7]\n APPLY_ABSTRACTION; [line 7]\n " shape="box"]
715 -> 714 ;
714 [label="714: Exit NullDeref_setBackgroundCoveringView: \n " color=yellow style=filled]
713 [label="713: Start NullDeref_setBackgroundCoveringView:\nFormals: self:class NullDeref * backgroundCoveringView:class UIView *\nLocals: \n DECLARE_LOCALS(&return); [line 7]\n " color=yellow style=filled]
713 -> 715 ;
712 [label="712: Return Stmt \n n$642=*&self:class NullDeref * [line 7]\n n$643=*n$642.NullDeref__backgroundCoveringView:class UIView * [line 7]\n *&return:class UIView *=n$643 [line 7]\n REMOVE_TEMPS(n$642,n$643); [line 7]\n NULLIFY(&self,false); [line 7]\n APPLY_ABSTRACTION; [line 7]\n " shape="box"]
712 -> 711 ;
711 [label="711: Exit NullDeref_backgroundCoveringView \n " color=yellow style=filled]
710 [label="710: Start NullDeref_backgroundCoveringView\nFormals: self:class NullDeref *\nLocals: \n DECLARE_LOCALS(&return); [line 7]\n " color=yellow style=filled]
710 -> 712 ;
709 [label="709: DeclStmt \n n$641=_fun___objc_alloc(sizeof(struct __SecKey ):struct __SecKey *) [line 39]\n *&allowedPublicKey:struct __SecKey *=n$641 [line 39]\n REMOVE_TEMPS(n$641); [line 39]\n " shape="box"]
709 -> 708 ;
708 [label="708: Call _fun___objc_release \n n$638=*&allowedPublicKey:struct __SecKey * [line 40]\n n$639=_fun___objc_release(1:_Bool ,n$638:void *) [line 40]\n REMOVE_TEMPS(n$638,n$639); [line 40]\n NULLIFY(&allowedPublicKey,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"]
708 -> 707 ;
707 [label="707: Exit NullDeref_test2 \n " color=yellow style=filled]
706 [label="706: Start NullDeref_test2\nFormals: \nLocals: allowedPublicKey:struct __SecKey * \n DECLARE_LOCALS(&return,&allowedPublicKey); [line 37]\n NULLIFY(&allowedPublicKey,false); [line 37]\n " color=yellow style=filled]
706 -> 709 ;
705 [label="705: DeclStmt \n n$636=*&rect:struct CGRect [line 29]\n n$637=_fun_CGRectGetHeight(n$636:struct CGRect ) [line 29]\n *&lineThickness:double =(0.200000 * n$637) [line 29]\n REMOVE_TEMPS(n$636,n$637); [line 29]\n NULLIFY(&rect,false); [line 29]\n NULLIFY(&lineThickness,false); [line 29]\n " shape="box"]
705 -> 704 ;
704 [label="704: DeclStmt \n n$635=_fun_CGPathCreateMutable() [line 32]\n *&path1:struct CGPath *=n$635 [line 32]\n REMOVE_TEMPS(n$635); [line 32]\n " shape="box"]
704 -> 703 ;
703 [label="703: Call _fun___objc_release \n n$633=*&path1:struct CGPath * [line 33]\n n$634=_fun___objc_release(1:_Bool ,n$633:void *) [line 33]\n REMOVE_TEMPS(n$633,n$634); [line 33]\n NULLIFY(&path1,false); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"]
703 -> 702 ;
702 [label="702: Exit NullDeref_createCloseCrossGlyphNoLeak: \n " color=yellow style=filled]
701 [label="701: Start NullDeref_createCloseCrossGlyphNoLeak:\nFormals: rect:struct CGRect \nLocals: lineThickness:double path1:struct CGPath * \n DECLARE_LOCALS(&return,&lineThickness,&path1); [line 27]\n NULLIFY(&lineThickness,false); [line 27]\n NULLIFY(&path1,false); [line 27]\n " color=yellow style=filled]
701 -> 705 ;
700 [label="700: DeclStmt \n n$632=_fun___objc_alloc(sizeof(struct __CFAttributedString ):struct __CFAttributedString *) [line 22]\n *&maString:struct __CFAttributedString *=n$632 [line 22]\n REMOVE_TEMPS(n$632); [line 22]\n " shape="box"]
700 -> 698 ;
700 -> 699 ;
699 [label="699: Prune (false branch) \n n$628=*&maString:struct __CFAttributedString * [line 21]\n PRUNE(!n$628, false); [line 23]\n REMOVE_TEMPS(n$628); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="invhouse"]
699 -> 696 ;
698 [label="698: Prune (true branch) \n n$628=*&maString:struct __CFAttributedString * [line 21]\n PRUNE(n$628, true); [line 23]\n REMOVE_TEMPS(n$628); [line 23]\n " shape="invhouse"]
698 -> 697 ;
697 [label="697: Call _fun___objc_release \n n$629=*&maString:struct __CFAttributedString * [line 23]\n n$630=_fun___objc_release(1:_Bool ,n$629:void *) [line 23]\n REMOVE_TEMPS(n$629,n$630); [line 23]\n NULLIFY(&maString,false); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"]
697 -> 696 ;
696 [label="696: + \n NULLIFY(&maString,false); [line 23]\n " ]
696 -> 695 ;
695 [label="695: Exit NullDeref_measureFrameSizeForTextNoLeak \n " color=yellow style=filled]
694 [label="694: Start NullDeref_measureFrameSizeForTextNoLeak\nFormals: \nLocals: maString:struct __CFAttributedString * \n DECLARE_LOCALS(&return,&maString); [line 20]\n NULLIFY(&maString,false); [line 20]\n " color=yellow style=filled]
694 -> 700 ;
693 [label="693: DeclStmt \n n$627=_fun___objc_alloc(sizeof(class UIView ):class UIView *) [line 12]\n *&attachmentContainerView:class UIView *=n$627 [line 12]\n REMOVE_TEMPS(n$627); [line 12]\n " shape="box"]
693 -> 692 ;
692 [label="692: DeclStmt \n n$624=*&attachmentContainerView:class UIView * [line 13]\n n$623=_fun_UIView_bounds(n$624:class UIView *) virtual [line 13]\n n$625=_fun_CGPathCreateWithRect(n$623:struct CGRect ,0:CGAffineTransform *) [line 13]\n *&shadowPath:struct CGPath *=n$625 [line 13]\n REMOVE_TEMPS(n$623,n$624,n$625); [line 13]\n " shape="box"]
692 -> 691 ;
691 [label="691: Call _fun___objc_release \n n$621=*&shadowPath:struct CGPath * [line 14]\n n$622=_fun___objc_release(1:_Bool ,n$621:void *) [line 14]\n REMOVE_TEMPS(n$621,n$622); [line 14]\n NULLIFY(&shadowPath,false); [line 14]\n " shape="box"]
691 -> 690 ;
690 [label="690: Message Call: release \n n$620=*&attachmentContainerView:class UIView * [line 15]\n n$619=_fun_NSObject_release(n$620:class UIView *) [line 15]\n REMOVE_TEMPS(n$619,n$620); [line 15]\n NULLIFY(&attachmentContainerView,false); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"]
690 -> 689 ;
689 [label="689: Exit NullDeref_layoutSubviews \n " color=yellow style=filled]
688 [label="688: Start NullDeref_layoutSubviews\nFormals: self:class NullDeref *\nLocals: attachmentContainerView:class UIView * shadowPath:struct CGPath * \n DECLARE_LOCALS(&return,&attachmentContainerView,&shadowPath); [line 10]\n NULLIFY(&attachmentContainerView,false); [line 10]\n NULLIFY(&self,false); [line 10]\n NULLIFY(&shadowPath,false); [line 10]\n " color=yellow style=filled]
688 -> 693 ;
}

@ -0,0 +1,90 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p)
OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
FILES_NOARC = \
block/BlockVar.m \
block/block-it.m \
block/block.m \
block/block_no_args.m \
block/block_release.m \
block/dispatch.m \
block/dispatch_examples.m \
block/retain_cycle.m \
block/static.m \
boxing/Boxing.m \
boxing/array.m \
boxing/array_literal.c \
boxing/dict_literal.c \
boxing/string_literal.c \
conditional_operation/ConditionalOperation.m \
exceptions/ExceptionExample.m \
fast_enumeration/Fast_enumeration.m \
property/PropertyAttributes.m \
property/PropertyCustomAccessor.m \
property/PropertyImplSetter.m \
property/Property_getter.m \
property/aclass.m \
property/main_car.m \
property_in_protocol/Test.m \
protocol/protocol.m \
returnstmt/void_return.m \
self_static/Self.m \
self_static/static.m \
strings/global_string_literal.m \
strings/string_literal.m \
subclass/MyClass.m \
subclass/MySubClass.m \
subclass/main.c \
types/testloop.m \
vardecl/aclass.m \
vardecl/aclass_2.m \
vardecl/last_af.m \
link_to_errors/category_procdesc/EOCPerson.m \
link_to_errors/category_procdesc/main.c \
link_to_errors/field_superclass/SuperExample.m \
link_to_errors/memory_leaks_benchmark/AutoreleaseExample.m \
link_to_errors/memory_leaks_benchmark/MemoryLeakExample.m \
link_to_errors/memory_leaks_benchmark/RetainReleaseExample.m \
link_to_errors/memory_leaks_benchmark/RetainReleaseExample2.m \
link_to_errors/memory_leaks_benchmark/TollBridgeExample.m \
link_to_errors/npe/npe_malloc.m \
link_to_errors/protocol_procdesc/main.c \
FILES_ARC = \
assertions/NSAssert_example.m \
predefined_expr/PredefinedExprExample.m \
types/attributes.m \
types/void_call.m \
vardecl/initlist.m \
link_to_errors/npe/Nonnull_attribute_example.m \
link_to_errors/memory_leaks_benchmark/ArcExample.m \
link_to_errors/memory_leaks_benchmark/arc_methods.m \
FILES = \
$(FILES_NOARC) \
$(FILES_ARC) \
compile:
clang $(OPTIONS) $(FILES_NOARC)
clang $(OPTIONS) -fobjc-arc $(FILES_ARC)
capture:
infer -a capture --cxx --frontend-tests --continue --reactive -- clang $(OPTIONS) $(FILES_NOARC)
infer -a capture --cxx --frontend-tests -- clang $(OPTIONS) -fobjc-arc $(FILES_ARC)

@ -29,7 +29,7 @@ digraph iCFG {
99 -> 104 ;
98 [label="98: DeclStmt \n n$16=_fun_NSString_stringWithUTF8String:(\"infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m\":char *) [line 36]\n _fun___objc_retain(n$16:class NSString *) [line 36]\n *&__assert_file__:class NSString *=n$16 [line 36]\n " shape="box"]
98 [label="98: DeclStmt \n n$16=_fun_NSString_stringWithUTF8String:(\"assertions/NSAssert_example.m\":char *) [line 36]\n _fun___objc_retain(n$16:class NSString *) [line 36]\n *&__assert_file__:class NSString *=n$16 [line 36]\n " shape="box"]
98 -> 93 ;
@ -58,10 +58,10 @@ digraph iCFG {
92 -> 97 ;
91 [label="91: Assertion failure \n _fun___infer_fail(\"ASSERTION_FAILURE\":void ) [line 36]\n " shape="box"]
91 [label="91: Prune (true branch) \n PRUNE(0, true); [line 36]\n " shape="invhouse"]
91 -> 78 ;
91 -> 83 ;
90 [label="90: Prune (false branch) \n n$4=*&0$?%__sil_tmpSIL_temp_conditional___n$2:int [line 36]\n PRUNE((n$4 == 0), false); [line 36]\n " shape="invhouse"]
@ -149,7 +149,7 @@ digraph iCFG {
70 -> 75 ;
69 [label="69: DeclStmt \n n$15=_fun_NSString_stringWithUTF8String:(\"infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m\":char *) [line 31]\n _fun___objc_retain(n$15:class NSString *) [line 31]\n *&__assert_file__:class NSString *=n$15 [line 31]\n " shape="box"]
69 [label="69: DeclStmt \n n$15=_fun_NSString_stringWithUTF8String:(\"assertions/NSAssert_example.m\":char *) [line 31]\n _fun___objc_retain(n$15:class NSString *) [line 31]\n *&__assert_file__:class NSString *=n$15 [line 31]\n " shape="box"]
69 -> 64 ;
@ -178,10 +178,10 @@ digraph iCFG {
63 -> 68 ;
62 [label="62: Assertion failure \n _fun___infer_fail(\"ASSERTION_FAILURE\":void ) [line 31]\n " shape="box"]
62 [label="62: Prune (true branch) \n PRUNE(0, true); [line 31]\n " shape="invhouse"]
62 -> 48 ;
62 -> 53 ;
61 [label="61: Prune (false branch) \n n$4=*&0$?%__sil_tmpSIL_temp_conditional___n$2:int [line 31]\n PRUNE((n$4 == 0), false); [line 31]\n " shape="invhouse"]
@ -244,7 +244,7 @@ digraph iCFG {
47 -> 50 ;
46 [label="46: DeclStmt \n n$33=_fun_NSString_stringWithUTF8String:(\"infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m\":char *) [line 24]\n _fun___objc_retain(n$33:class NSString *) [line 24]\n *&__assert_file__:class NSString *=n$33 [line 24]\n " shape="box"]
46 [label="46: DeclStmt \n n$33=_fun_NSString_stringWithUTF8String:(\"assertions/NSAssert_example.m\":char *) [line 24]\n _fun___objc_retain(n$33:class NSString *) [line 24]\n *&__assert_file__:class NSString *=n$33 [line 24]\n " shape="box"]
46 -> 41 ;
@ -273,10 +273,10 @@ digraph iCFG {
40 -> 45 ;
39 [label="39: Assertion failure \n _fun___infer_fail(\"ASSERTION_FAILURE\":void ) [line 24]\n " shape="box"]
39 [label="39: Prune (true branch) \n PRUNE(0, true); [line 24]\n " shape="invhouse"]
39 -> 25 ;
39 -> 30 ;
38 [label="38: Prune (false branch) \n n$21=*&0$?%__sil_tmpSIL_temp_conditional___n$19:int [line 24]\n PRUNE((n$21 == 0), false); [line 24]\n " shape="invhouse"]
@ -339,7 +339,7 @@ digraph iCFG {
24 -> 27 ;
23 [label="23: DeclStmt \n n$16=_fun_NSString_stringWithUTF8String:(\"infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m\":char *) [line 19]\n _fun___objc_retain(n$16:class NSString *) [line 19]\n *&__assert_file__:class NSString *=n$16 [line 19]\n " shape="box"]
23 [label="23: DeclStmt \n n$16=_fun_NSString_stringWithUTF8String:(\"assertions/NSAssert_example.m\":char *) [line 19]\n _fun___objc_retain(n$16:class NSString *) [line 19]\n *&__assert_file__:class NSString *=n$16 [line 19]\n " shape="box"]
23 -> 18 ;
@ -368,10 +368,10 @@ digraph iCFG {
17 -> 22 ;
16 [label="16: Assertion failure \n _fun___infer_fail(\"ASSERTION_FAILURE\":void ) [line 19]\n " shape="box"]
16 [label="16: Prune (true branch) \n PRUNE(0, true); [line 19]\n " shape="invhouse"]
16 -> 2 ;
16 -> 7 ;
15 [label="15: Prune (false branch) \n n$4=*&0$?%__sil_tmpSIL_temp_conditional___n$2:int [line 19]\n PRUNE((n$4 == 0), false); [line 19]\n " shape="invhouse"]

@ -25,7 +25,7 @@
- (int)while_loop:(NSArray*)items {
int size = 0;
NSArray* item = nil;
while (item = [items nextObject]) {
while ((item = [items objectAtIndex:3])) {
size += [item count];
}
return size;

@ -20,7 +20,7 @@ digraph iCFG {
17 -> 19 ;
16 [label="16: BinaryOperatorStmt: Assign \n n$10=*&items:class NSArray * [line 28]\n n$11=_fun_NSArray_nextObject(n$10:class NSArray *) virtual [line 28]\n *&item:class NSArray *=n$11 [line 28]\n n$12=*&item:class NSArray * [line 28]\n " shape="box"]
16 [label="16: BinaryOperatorStmt: Assign \n n$10=*&items:class NSArray * [line 28]\n n$11=_fun_NSArray_objectAtIndex:(n$10:class NSArray *,3:unsigned long ) virtual [line 28]\n *&item:class NSArray *=n$11 [line 28]\n n$12=*&item:class NSArray * [line 28]\n " shape="box"]
16 -> 17 ;

@ -1,9 +1,9 @@
/* @generated */
digraph iCFG {
21 [label="21: Exit frontend_checks_23a4fcc8f25cc8087aa9202ac0edfbf5 \n " color=yellow style=filled]
21 [label="21: Exit frontend_checks_b9a66dfb333031907793a9bdd13fca5f \n " color=yellow style=filled]
20 [label="20: Start frontend_checks_23a4fcc8f25cc8087aa9202ac0edfbf5\nFormals: \nLocals: \n " color=yellow style=filled]
20 [label="20: Start frontend_checks_b9a66dfb333031907793a9bdd13fca5f\nFormals: \nLocals: \n " color=yellow style=filled]
20 -> 21 ;

@ -9,6 +9,11 @@
#import <Foundation/NSObject.h>
@interface A : NSObject {
int x;
}
@end
@implementation A
- (instancetype)init {

@ -0,0 +1,29 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p)
OPTIONS = -x objective-c++ -std=c++11 \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
FILES = \
funcoverloading/af_test.mm \
global_const/global_const.mm \
compile:
clang $(OPTIONS) $(FILES)
capture:
infer -a capture --cxx --frontend-tests --continue --reactive -- clang $(OPTIONS) $(FILES)

@ -11,22 +11,10 @@ tests_dependencies = [
'//infer/tests/codetoanalyze/java/infer:infer',
]
# ############### ObjCpp endtoend tests ########################
java_test(
name='objcpp_endtoend_tests',
deps=[
'//infer/tests/endtoend/objcpp/infer:infer',
],
visibility=[
'PUBLIC',
],
)
# ############### Java endtoend tests ########################
java_test(
name='java_endtoend_tests',
deps=[
'//infer/tests/endtoend/java/infer:infer',
'//infer/tests/endtoend/java/crashcontext:crashcontext',
'//infer/tests/endtoend/java/harness:harness',
],

@ -1,63 +0,0 @@
tests_dependencies = [
'//infer/lib/java/android:android',
'//dependencies/java/guava:guava',
'//dependencies/java/junit:hamcrest',
'//dependencies/java/jackson:jackson',
'//dependencies/java/jsr-305:jsr-305',
'//dependencies/java/junit:junit',
'//dependencies/java/opencsv:opencsv',
'//infer/tests/utils:utils'
]
integration_tests = [
'//infer/tests:integration_tests',
'//infer/tests:objc_tests',
'//infer/tests:objcpp_tests',
]
# ############### objc frontend tests ########################
objc_test_sources = glob(['objc/**/*.java'])
objc_frontend_test_deps = []
for test_source in objc_test_sources:
target_name = test_source.replace("/", "_")[:-len(".java")]
objc_frontend_test_deps.append(target_name)
java_test(
name=target_name,
srcs=[test_source],
deps=tests_dependencies,
visibility=integration_tests,
source='7',
target='7',
)
java_test(
name='objc_frontend_tests',
deps=[':' + x for x in objc_frontend_test_deps],
visibility=integration_tests,
)
# ############### objcpp frontend tests ########################
objcpp_test_sources = glob(['objcpp/**/*.java'])
objcpp_frontend_test_deps = []
for test_source in objcpp_test_sources:
target_name = test_source.replace("/", "_")[:-len(".java")]
objcpp_frontend_test_deps.append(target_name)
java_test(
name=target_name,
srcs=[test_source],
deps=tests_dependencies,
visibility=integration_tests,
source='7',
target='7',
)
java_test(
name='objcpp_frontend_tests',
deps=[':' + x for x in objcpp_frontend_test_deps],
visibility=integration_tests,
)

@ -1,86 +0,0 @@
/*
* Copyright (c) 2014 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ArcExampleTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src = "infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureInitlistThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src = "infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnArcExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String arc_src = "infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.m";
String arc_dotty =
"infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, arc_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + arc_src + " the dotty files should be the same.",
newDotFile, dotFileEqualTo(arc_dotty));
}
}

@ -1,208 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class BlockTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/" +
"block/block.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"block/block.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnBlockVarThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/BlockVar.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnBlockReleaseThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/block_release.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/block_release.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnBlockNoArgsThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/block_no_args.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/block_no_args.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnStaticThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/static.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/static.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnRetainCycleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnDispatchThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/dispatch.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnDispatch_exampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnBlockit_exampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/block/block-it.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/block/block-it.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
}

@ -1,149 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class BoxingTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnBoxingThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String boxing_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/Boxing.m";
String boxing_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/Boxing.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, boxing_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + boxing_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(boxing_dotty));
}
@Test
public void whenCaptureRunOnArray_literalThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String arr_literal_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/array_literal.c";
String arr_literal_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/array_literal.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
arr_literal_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + arr_literal_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(arr_literal_dotty));
}
@Test
public void whenCaptureRunOnDict_literalThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String dict_literal_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/dict_literal.c";
String dict_literal_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/dict_literal.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
dict_literal_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + dict_literal_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(dict_literal_dotty));
}
@Test
public void whenCaptureRunOnString_literalThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String string_literal_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/string_literal.c";
String string_literal_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/boxing/string_literal.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
string_literal_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + string_literal_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(string_literal_dotty));
}
@Test
public void whenCaptureRunOnForCollection_ThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String array_expr =
"infer/tests/codetoanalyze/objc/frontend/boxing/array.m";
String array_dotty =
"infer/tests/codetoanalyze/objc/frontend/boxing/array.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, array_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + array_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(array_dotty));
}
}

@ -1,78 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class CategoryTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnmainThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String cat_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/category_procdesc/main.c";
String cat_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/category_procdesc/main.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, cat_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + cat_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(cat_dotty));
}
@Test
public void whenCaptureRunOnEOCPersonThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String cat_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/category_procdesc/EOCPerson.m";
String cat_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/category_procdesc/EOCPerson.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, cat_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + cat_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(cat_dotty));
}
}

@ -1,51 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ConditionalOperatorTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunCommaThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String cond_src =
"infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m";
String cond_dotty =
"infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
cond_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + cond_src + " the dotty files should be the same.",
newDotFile, dotFileEqualTo(cond_dotty));
}
}

@ -1,52 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ExceptionTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnTestThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String exception_src =
"infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m";
String exception_dotty =
"infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, exception_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + exception_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(exception_dotty));
}
}

@ -1,51 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class FastEnumerationTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnTestThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String exception_src =
"infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m";
String exception_dotty =
"infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, exception_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + exception_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(exception_dotty));
}
}

@ -1,92 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class LateDefinedVarDeclTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunLateDefinedStaticVarThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/aclass.m";
String dot_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/aclass.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, src_file);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src_file +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dot_file));
}
@Test
public void whenCaptureRunLateDefinedVarThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/aclass_2.m";
String dot_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/aclass_2.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, src_file);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src_file +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dot_file));
}
@Test
public void whenCaptureRunOnFunctionDeclWithOrderedVarDeclsThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/last_af.m";
String dot_file =
"infer/tests/" +
"codetoanalyze/objc/frontend/vardecl/last_af.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, src_file);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src_file +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dot_file));
}
}

@ -1,50 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class MallocTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunLateDefinedStaticVarThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src_file =
"infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.m";
String dot_file =
"infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, src_file);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src_file +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dot_file));
}
}

@ -1,134 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class MemoryLeakBenchmarkTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnMemoryLeakExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String ml_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/MemoryLeakExample.m";
String ml_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, ml_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + ml_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(ml_dotty));
}
@Test
public void whenCaptureRunOnRetainReleaseExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String ml_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/RetainReleaseExample.m";
String ml_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, ml_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + ml_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(ml_dotty));
}
@Test
public void whenCaptureRunOnRetainReleaseExample2ThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String ml_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/RetainReleaseExample2.m";
String ml_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, ml_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + ml_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(ml_dotty));
}
@Test
public void whenCaptureRunOnAutoreleaseExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String ml_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/AutoreleaseExample.m";
String ml_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, ml_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + ml_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(ml_dotty));
}
@Test
public void whenCaptureRunOnTollBridgeExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String ml_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/TollBridgeExample.m";
String ml_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/memory_leaks_benchmark/TollBridgeExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createiOSInferCommandFrontend(folder, ml_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + ml_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(ml_dotty));
}
}

@ -1,50 +0,0 @@
/*
* Copyright (c) 2014 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class NSAssertTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src = "infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m";
String dotty = "infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src + " the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty));
}
}

@ -1,48 +0,0 @@
/*
* Copyright (c) 2014 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class NonnullAttributeTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnNonnullAttributeExampleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src = "infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.m";
String dotty = "infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot";
ImmutableList<String> inferCmd = InferRunner.createObjCInferCommandFrontendArc(folder, src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src + " the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty));
}
}

@ -1,51 +0,0 @@
/*
* Copyright (c) 2014 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class PredefinedExpressionTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src = "infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m";
String dotty =
"infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty));
}
}

@ -1,172 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class PropertyTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/property/main_car.m";
String property_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/property/main_car.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnDynamicPropertyThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/property/aclass.m";
String property_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/property/aclass.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnPropertyInProtocolThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/objc/frontend/" +
"property_in_protocol/Test.m";
String property_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"property_in_protocol/Test.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnPropertyImplSetterThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/objc/frontend/" +
"property/PropertyImplSetter.m";
String property_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"property/PropertyImplSetter.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnPropertyAttributesThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/objc/frontend/" +
"property/PropertyAttributes.m";
String property_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"property/PropertyAttributes.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnProperty_getterThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m";
String property_dotty =
"infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnPropertyCustomAccessorThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m";
String property_dotty =
"infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
}

@ -1,80 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ProtocolTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnProtocolThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String protocol_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/protocol/protocol.m";
String protocol_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/protocol/protocol.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
protocol_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + protocol_expr +
" the dotty files should be the same. " +
"In each procedure the translation of the boxing " +
"syntactic sugar is the same " +
"as the tranlation of the underlying method call.",
newDotFile, dotFileEqualTo(protocol_dotty));
}
@Test
public void whenCaptureRunOnBicycleThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String protocol_expr =
"infer/tests/codetoanalyze/" +
"objc/errors/protocol_procdesc/main.c";
String protocol_dotty =
"infer/tests/codetoanalyze/" +
"objc/errors/protocol_procdesc/main.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
protocol_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + protocol_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(protocol_dotty));
}
}

@ -1,55 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ReturnTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnVoidReturnThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String src_file =
"infer/tests/codetoanalyze/objc/frontend/" +
"returnstmt/void_return.m";
String dotty_file =
"infer/tests/codetoanalyze/objc/frontend/" +
"returnstmt/void_return.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, src_file);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + src_file +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty_file));
}
}

@ -1,93 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class StaticSelf {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnStaticThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String property_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/self_static/static.m";
String property_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/self_static/static.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
property_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + property_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(property_dotty));
}
@Test
public void whenCaptureRunOnSuperTestThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String expr = "infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.m";
String dotty = "infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty));
}
@Test
public void whenCaptureRunOnSelfThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String expr = "infer/tests/codetoanalyze/objc/frontend/self_static/Self.m";
String dotty = "infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(dotty));
}
}

@ -1,72 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class StringTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnStringLiteralThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String string_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/strings/string_literal.m";
String string_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/strings/string_literal.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, string_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + string_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(string_dotty));
}
@Test
public void whenCaptureRunOnGlobalStringLiteralThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String string_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/strings/global_string_literal.m";
String string_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/strings/global_string_literal.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, string_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + string_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(string_dotty));
}
}

@ -1,96 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class SubclassTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnStringLiteralThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String myClass_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/subclass/MyClass.m";
String string_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/subclass/MyClass.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
myClass_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + myClass_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(string_dotty));
}
@Test
public void whenCaptureRunOnGlobalStringLiteralThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String mySubClass_expr =
"infer/tests/codetoanalyze/" +
"objc/frontend/subclass/MySubClass.m";
String string_dotty =
"infer/tests/codetoanalyze/" +
"objc/frontend/subclass/MySubClass.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
mySubClass_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + mySubClass_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(string_dotty));
}
@Test
public void whenCaptureRunOnMainThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String mySubClass_expr = "infer/tests/codetoanalyze/objc/frontend/subclass/main.c";
String string_dotty = "infer/tests/codetoanalyze/objc/frontend/subclass/main.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(
folder,
mySubClass_expr);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + mySubClass_expr +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(string_dotty));
}
}

@ -1,96 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objc;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class TypesTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunOnTestLoopThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/testloop.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/testloop.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontend(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnAttributesThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/attributes.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/attributes.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
@Test
public void whenCaptureRunOnVoidCall()
throws InterruptedException, IOException, InferException {
String block_src =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/void_call.m";
String block_dotty =
"infer/tests/codetoanalyze/objc/frontend/" +
"types/void_call.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCInferCommandFrontendArc(folder, block_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + block_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(block_dotty));
}
}

@ -1,52 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objcpp;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class FuncOverloadingTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunSwitchStmtThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String switch_src =
"infer/tests/codetoanalyze/objcpp/frontend/" +
"funcoverloading/af_test.mm";
String switch_dotty =
"infer/tests/codetoanalyze/objcpp/frontend/" +
"funcoverloading/af_test.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCPPInferCommand(folder, switch_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + switch_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(switch_dotty));
}
}

@ -1,49 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package frontend.objcpp;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class GlobalConstTest {
@Rule
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@Test
public void whenCaptureRunSwitchStmtThenDotFilesAreTheSame()
throws InterruptedException, IOException, InferException {
String switch_src =
"infer/tests/codetoanalyze/objcpp/frontend/global_const/global_const.mm";
String switch_dotty =
"infer/tests/codetoanalyze/objcpp/frontend/global_const/global_const.mm.dot";
ImmutableList<String> inferCmd =
InferRunner.createObjCPPInferCommand(folder, switch_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + switch_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(switch_dotty));
}
}

@ -1,72 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package utils;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.DotFilesEqual.dotFileEqualTo;
import com.google.common.collect.ImmutableList;
import java.io.File;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferRunner;
public class ClangFrontendUtils {
public static void createAndCompareCppDotFiles (
DebuggableTemporaryFolder folder,
String pathToSrcFile,
boolean headers)
throws InterruptedException, IOException, InferException {
String test_src = pathToSrcFile;
String test_dotty = pathToSrcFile + ".dot";
ImmutableList<String> inferCmd;
if (headers)
inferCmd = InferRunner.createCPPInferCommandIncludeHeaders(folder, test_src);
else
inferCmd = InferRunner.createCPPInferCommandFrontend(folder, test_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + test_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(test_dotty));
}
public static void createAndCompareCppDotFiles(DebuggableTemporaryFolder folder,
String pathToSrcFile)
throws InterruptedException, IOException, InferException {
createAndCompareCppDotFiles(folder, pathToSrcFile, false);
}
public static void createAndCompareCppDotFilesIncludeHeaders(DebuggableTemporaryFolder folder,
String pathToSrcFile)
throws InterruptedException, IOException, InferException {
createAndCompareCppDotFiles(folder, pathToSrcFile, true);
}
public static void createAndCompareCDotFiles(DebuggableTemporaryFolder folder, String pathToSrcFile)
throws InterruptedException, IOException, InferException {
String test_src = pathToSrcFile;
String test_dotty = pathToSrcFile + ".dot";
ImmutableList<String> inferCmd =
InferRunner.createCInferCommandFrontend(
folder,
test_src);
File newDotFile = InferRunner.runInferFrontend(inferCmd);
assertThat(
"In the capture of " + test_src +
" the dotty files should be the same.",
newDotFile, dotFileEqualTo(test_dotty));
}
}

@ -52,12 +52,6 @@ public class InferRunner {
"/dependencies/java/jackson/jackson-2.2.3.jar",
};
private static final String CXX_INCLUDE_DIR =
"/facebook-clang-plugins/clang/install/include/c++/v1/";
private static final String IPHONESIMULATOR_ISYSROOT_SUFFIX =
"/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk";
private static HashMap<String, InferResults> inferResultsMap =
new HashMap<String, InferResults>();
@ -159,417 +153,6 @@ public class InferRunner {
return createInferJavaCommand(folder, sourceFiles, "infer", args);
}
public static String getClangLangOption(Language lang) {
String langOption = "";
switch (lang) {
case C:
langOption = "c";
break;
case ObjC:
langOption = "objective-c";
break;
case CPP:
langOption = "c++";
break;
case ObjCPP:
langOption = "objective-c++";
break;
default:
throw new RuntimeException(
"It should be called only with the "
+ "languages (C, C++, ObjC, ObjC++)");
}
return langOption;
}
public static String getStdParam(Language lang) {
String stdParam = "";
switch (lang) {
case CPP:
stdParam = "-std=c++11";
break;
case ObjCPP:
stdParam = "-std=c++11";
break;
}
return stdParam;
}
private static String getSystemHeaderFlag(Language lang) {
String headerFlag = "";
switch (lang) {
case CPP:
String current_dir = System.getProperty("user.dir");
headerFlag = new StringBuilder()
.append("-isystem")
.append(current_dir)
.append(CXX_INCLUDE_DIR)
.toString();
break;
}
return headerFlag;
}
public static ImmutableList<String> createClangCommand(
String sourceFile,
Language lang,
@Nullable String isysroot,
boolean arc) {
ImmutableList.Builder<String> isysrootOption =
new ImmutableList.Builder<>();
if (isysroot != null) {
isysrootOption
.add("-isysroot")
.add(isysroot)
.add("-mios-simulator-version-min=8.2")
.add("--target=x86_64-apple-darwin14");
}
ImmutableList.Builder<String> arcOption =
new ImmutableList.Builder<>();
if (arc) {
arcOption.add("-fobjc-arc");
}
ImmutableList<String> clangCmd = new ImmutableList.Builder<String>()
.add("clang")
.add("-x")
.add(getClangLangOption(lang))
.add(getStdParam(lang))
.add(getSystemHeaderFlag(lang))
.addAll(isysrootOption.build())
.addAll(arcOption.build())
.add("-c")
.add(sourceFile)
.add("-o")
.add(sourceFile + ".o")
.build();
return clangCmd;
}
public static ImmutableList<String> createClangInferCommand(
TemporaryFolder folder,
String sourceFile,
Language lang,
@Nullable String isysroot,
boolean arc,
ImmutableList<String> inferOptions) {
File resultsDir = createResultsDir(folder);
String resultsDirName = resultsDir.getAbsolutePath();
InferRunner.bugsFile = new File(resultsDir, BUGS_FILE_NAME);
return new ImmutableList.Builder<String>()
.add("infer")
.add("--cxx")
.add("--no-filtering")
.add("--out")
.add(resultsDirName)
.add("--no-progress-bar")
.add("--testing-mode")
.addAll(inferOptions)
.add("--")
.addAll(createClangCommand(sourceFile, lang, isysroot, arc))
.build();
}
public static ImmutableList<String> createClangInferCommand(
TemporaryFolder folder,
String sourceFile,
Language lang,
String analyzer,
@Nullable String isysroot,
@Nullable String ml_buckets,
boolean arc,
ImmutableList<String> extraInferOptions) {
ImmutableList.Builder<String> inferOptionsBuilder = new ImmutableList.Builder<String>()
.addAll(extraInferOptions);
inferOptionsBuilder.add("--analyzer").add(analyzer);
inferOptionsBuilder
.add("--ml_buckets")
.add(ml_buckets == null ? "all" : ml_buckets);
return createClangInferCommand(
folder,
sourceFile,
lang,
isysroot,
arc,
inferOptionsBuilder.build());
}
public static ImmutableList<String> createCInferCommandFrontend(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) {
return createClangInferCommand(
folder,
sourceFile,
Language.C,
"capture",
null,
null,
false,
extraInferOptions);
}
public static ImmutableList<String> createCInferCommandFrontend(
TemporaryFolder folder,
String sourceFile) {
return createCInferCommandFrontend(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createCPPInferCommandFrontend(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) {
return createClangInferCommand(
folder,
sourceFile,
Language.CPP,
"capture",
null,
null,
false,
extraInferOptions);
}
public static ImmutableList<String> createCPPInferCommandFrontend(
TemporaryFolder folder,
String sourceFile) {
return createCPPInferCommandFrontend(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCInferCommandFrontend(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"capture",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
extraInferOptions);
}
public static ImmutableList<String> createObjCInferCommandFrontend(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createObjCInferCommandFrontend(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCInferCommandFrontendArc(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"capture",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
true,
extraInferOptions);
}
public static ImmutableList<String> createObjCInferCommandFrontendArc(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createObjCInferCommandFrontendArc(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCPPInferCommandFrontend(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjCPP,
"capture",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
extraInferOptions);
}
public static ImmutableList<String> createObjCPPInferCommandFrontend(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createObjCPPInferCommandFrontend(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createCInferCommand(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) {
return createClangInferCommand(
folder,
sourceFile,
Language.C,
"infer",
null,
null,
false,
extraInferOptions);
}
public static ImmutableList<String> createCInferCommand(
TemporaryFolder folder,
String sourceFile) {
return createCInferCommand(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createCPPInferCommand(
TemporaryFolder folder,
String sourceFile,
ImmutableList<String> extraInferOptions) {
ImmutableList<String> args = new ImmutableList.Builder<String> ()
.add("--no-testing-mode")
.addAll(extraInferOptions)
.build();
return createClangInferCommand(
folder,
sourceFile,
Language.CPP,
"infer",
null,
null,
false,
args);
}
public static ImmutableList<String> createCPPInferCommand(
TemporaryFolder folder,
String sourceFile) {
return createCPPInferCommand(folder, sourceFile, ImmutableList.<String>of());
}
public static ImmutableList<String> createCPPInferCommandIncludeHeaders(
TemporaryFolder folder,
String sourceFile) {
return createCPPInferCommand(
folder,
sourceFile,
ImmutableList.<String>of("--testing-mode", "--headers"));
}
public static ImmutableList<String> createCPPInferCommandWithMLBuckets(
TemporaryFolder folder,
String sourceFile,
String ml_bucket) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.CPP,
"infer",
null,
ml_bucket,
false,
ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCInferCommand(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCInferCommandWithMLBuckets(
TemporaryFolder folder,
String sourceFile,
String ml_bucket,
boolean arc) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
ml_bucket,
arc,
ImmutableList.<String>of());
}
public static ImmutableList<String> createObjCPPInferCommand(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjCPP,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
ImmutableList.<String>of());
}
public static ImmutableList<String> createiOSInferCommandFrontend(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
ImmutableList.<String>of());
}
public static ImmutableList<String> createiOSInferCommand(
TemporaryFolder folder,
String sourceFile) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
null,
false,
ImmutableList.<String>of());
}
public static ImmutableList<String> createiOSInferCommandWithMLBuckets(
TemporaryFolder folder,
String sourceFile,
String bucket,
boolean arc) throws IOException, InterruptedException {
return createClangInferCommand(
folder,
sourceFile,
Language.ObjC,
"infer",
getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX,
bucket,
arc,
ImmutableList.<String>of());
}
@Nullable
public static File runInferFrontend(ImmutableList<String> inferCmd)
throws IOException, InterruptedException, InferException {
runCommand(inferCmd, TestType.FRONTEND);
return dotFile;
}
private static InferResults runInfer(
ImmutableList<String> inferCmd,
Language lang)

Loading…
Cancel
Save