From c134eac91e5023b962bfb7a2cff10e7fa1c47dc1 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Tue, 20 Sep 2016 00:31:48 -0700 Subject: [PATCH] [tests] Convert objective-c frontend tests to new direct format Reviewed By: jberdine Differential Revision: D3886011 fbshipit-source-id: 2e0c014 --- .buckconfig | 8 - Makefile | 24 +- infer/tests/BUCK | 22 - infer/tests/codetoanalyze/Makefile.frontend | 2 +- .../tests/codetoanalyze/objc/errors/Makefile | 5 +- .../{EOCPerson.dot => EOCPerson.m.dot} | 0 .../{main.dot => main.c.dot} | 0 .../{SuperExample.dot => SuperExample.m.dot} | 0 .../{ArcExample.dot => ArcExample.m.dot} | 0 ...seExample.dot => AutoreleaseExample.m.dot} | 7 + ...eakExample.dot => MemoryLeakExample.m.dot} | 0 ...Example.dot => RetainReleaseExample.m.dot} | 0 ...ample2.dot => RetainReleaseExample2.m.dot} | 0 ...dgeExample.dot => TollBridgeExample.m.dot} | 0 .../{arc_methods.dot => arc_methods.m.dot} | 0 .../objc/errors/npe/NPD_core_foundation.dot | 131 ------ ...le.dot => Nonnull_attribute_example.m.dot} | 0 .../npe/{npe_malloc.dot => npe_malloc.m.dot} | 0 .../{main.dot => main.c.dot} | 0 .../codetoanalyze/objc/frontend/Makefile | 90 ++++ ...ert_example.dot => NSAssert_example.m.dot} | 24 +- .../block/{BlockVar.dot => BlockVar.m.dot} | 0 .../block/{block-it.dot => block-it.m.dot} | 0 .../frontend/block/{block.dot => block.m.dot} | 0 ...{block_no_args.dot => block_no_args.m.dot} | 0 ...{block_release.dot => block_release.m.dot} | 0 .../block/{dispatch.dot => dispatch.m.dot} | 0 ...h_examples.dot => dispatch_examples.m.dot} | 0 .../{retain_cycle.dot => retain_cycle.m.dot} | 0 .../block/{static.dot => static.m.dot} | 0 .../boxing/{Boxing.dot => Boxing.m.dot} | 0 .../boxing/{array.dot => array.m.dot} | 0 ...{array_literal.dot => array_literal.c.dot} | 0 .../{dict_literal.dot => dict_literal.c.dot} | 0 ...tring_literal.dot => string_literal.c.dot} | 0 ...eration.dot => ConditionalOperation.m.dot} | 0 ...tionExample.dot => ExceptionExample.m.dot} | 0 .../fast_enumeration/Fast_enumeration.m | 2 +- ...enumeration.dot => Fast_enumeration.m.dot} | 2 +- .../objc/frontend/link_to_errors | 1 + ...xample.dot => PredefinedExprExample.m.dot} | 0 ...ttributes.dot => PropertyAttributes.m.dot} | 4 +- ...essor.dot => PropertyCustomAccessor.m.dot} | 0 ...mplSetter.dot => PropertyImplSetter.m.dot} | 0 ...perty_getter.dot => Property_getter.m.dot} | 0 .../property/{aclass.dot => aclass.m.dot} | 0 .../property/{main_car.dot => main_car.m.dot} | 0 .../{Test.dot => Test.m.dot} | 0 .../protocol/{protocol.dot => protocol.m.dot} | 0 .../{void_return.dot => void_return.m.dot} | 0 .../self_static/{Self.dot => Self.m.dot} | 0 .../self_static/{static.dot => static.m.dot} | 0 ...iteral.dot => global_string_literal.m.dot} | 0 ...tring_literal.dot => string_literal.m.dot} | 0 .../codetoanalyze/objc/frontend/subclass/A.m | 5 + .../subclass/{MyClass.dot => MyClass.m.dot} | 0 .../{MySubClass.dot => MySubClass.m.dot} | 0 .../subclass/{main.dot => main.c.dot} | 0 .../{attributes.dot => attributes.m.dot} | 0 .../types/{testloop.dot => testloop.m.dot} | 0 .../types/{void_call.dot => void_call.m.dot} | 0 .../vardecl/{aclass.dot => aclass.m.dot} | 0 .../vardecl/{aclass_2.dot => aclass_2.m.dot} | 0 .../vardecl/{initlist.dot => initlist.m.dot} | 0 .../vardecl/{last_af.dot => last_af.m.dot} | 0 .../codetoanalyze/objcpp/frontend/Makefile | 29 ++ .../{af_test.dot => af_test.mm.dot} | 0 infer/tests/endtoend/BUCK | 12 - infer/tests/frontend/BUCK | 63 --- infer/tests/frontend/objc/ArcExampleTest.java | 86 ---- infer/tests/frontend/objc/BlockTest.java | 208 --------- infer/tests/frontend/objc/BoxingTest.java | 149 ------- infer/tests/frontend/objc/CategoryTest.java | 78 ---- .../objc/ConditionalOperatorTest.java | 51 --- infer/tests/frontend/objc/ExceptionTest.java | 52 --- .../frontend/objc/FastEnumerationTest.java | 51 --- .../frontend/objc/LateDefinedVarDeclTest.java | 92 ---- infer/tests/frontend/objc/MallocTest.java | 50 --- .../objc/MemoryLeakBenchmarkTest.java | 134 ------ infer/tests/frontend/objc/NSAssertTest.java | 50 --- .../frontend/objc/NonnullAttributeTest.java | 48 -- .../objc/PredefinedExpressionTest.java | 51 --- infer/tests/frontend/objc/PropertyTest.java | 172 -------- infer/tests/frontend/objc/ProtocolTest.java | 80 ---- infer/tests/frontend/objc/ReturnTest.java | 55 --- infer/tests/frontend/objc/StaticSelf.java | 93 ---- infer/tests/frontend/objc/StringTest.java | 72 --- infer/tests/frontend/objc/SubclassTest.java | 96 ---- infer/tests/frontend/objc/TypesTest.java | 96 ---- .../frontend/objcpp/FuncOverloadingTest.java | 52 --- .../frontend/objcpp/GlobalConstTest.java | 49 -- infer/tests/utils/ClangFrontendUtils.java | 72 --- infer/tests/utils/InferRunner.java | 417 ------------------ 93 files changed, 171 insertions(+), 2614 deletions(-) delete mode 100644 infer/tests/BUCK rename infer/tests/codetoanalyze/objc/errors/category_procdesc/{EOCPerson.dot => EOCPerson.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/category_procdesc/{main.dot => main.c.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/field_superclass/{SuperExample.dot => SuperExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{ArcExample.dot => ArcExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{AutoreleaseExample.dot => AutoreleaseExample.m.dot} (95%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{MemoryLeakExample.dot => MemoryLeakExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{RetainReleaseExample.dot => RetainReleaseExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{RetainReleaseExample2.dot => RetainReleaseExample2.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{TollBridgeExample.dot => TollBridgeExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/{arc_methods.dot => arc_methods.m.dot} (100%) delete mode 100644 infer/tests/codetoanalyze/objc/errors/npe/NPD_core_foundation.dot rename infer/tests/codetoanalyze/objc/errors/npe/{Nonnull_attribute_example.dot => Nonnull_attribute_example.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/npe/{npe_malloc.dot => npe_malloc.m.dot} (100%) rename infer/tests/codetoanalyze/objc/errors/protocol_procdesc/{main.dot => main.c.dot} (100%) create mode 100644 infer/tests/codetoanalyze/objc/frontend/Makefile rename infer/tests/codetoanalyze/objc/frontend/assertions/{NSAssert_example.dot => NSAssert_example.m.dot} (92%) rename infer/tests/codetoanalyze/objc/frontend/block/{BlockVar.dot => BlockVar.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{block-it.dot => block-it.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{block.dot => block.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{block_no_args.dot => block_no_args.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{block_release.dot => block_release.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{dispatch.dot => dispatch.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{dispatch_examples.dot => dispatch_examples.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{retain_cycle.dot => retain_cycle.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/block/{static.dot => static.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/boxing/{Boxing.dot => Boxing.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/boxing/{array.dot => array.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/boxing/{array_literal.dot => array_literal.c.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/boxing/{dict_literal.dot => dict_literal.c.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/boxing/{string_literal.dot => string_literal.c.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/conditional_operation/{ConditionalOperation.dot => ConditionalOperation.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/exceptions/{ExceptionExample.dot => ExceptionExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/fast_enumeration/{Fast_enumeration.dot => Fast_enumeration.m.dot} (92%) create mode 120000 infer/tests/codetoanalyze/objc/frontend/link_to_errors rename infer/tests/codetoanalyze/objc/frontend/predefined_expr/{PredefinedExprExample.dot => PredefinedExprExample.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property/{PropertyAttributes.dot => PropertyAttributes.m.dot} (93%) rename infer/tests/codetoanalyze/objc/frontend/property/{PropertyCustomAccessor.dot => PropertyCustomAccessor.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property/{PropertyImplSetter.dot => PropertyImplSetter.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property/{Property_getter.dot => Property_getter.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property/{aclass.dot => aclass.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property/{main_car.dot => main_car.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/property_in_protocol/{Test.dot => Test.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/protocol/{protocol.dot => protocol.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/returnstmt/{void_return.dot => void_return.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/self_static/{Self.dot => Self.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/self_static/{static.dot => static.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/strings/{global_string_literal.dot => global_string_literal.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/strings/{string_literal.dot => string_literal.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/subclass/{MyClass.dot => MyClass.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/subclass/{MySubClass.dot => MySubClass.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/subclass/{main.dot => main.c.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/types/{attributes.dot => attributes.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/types/{testloop.dot => testloop.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/types/{void_call.dot => void_call.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/vardecl/{aclass.dot => aclass.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/vardecl/{aclass_2.dot => aclass_2.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/vardecl/{initlist.dot => initlist.m.dot} (100%) rename infer/tests/codetoanalyze/objc/frontend/vardecl/{last_af.dot => last_af.m.dot} (100%) create mode 100644 infer/tests/codetoanalyze/objcpp/frontend/Makefile rename infer/tests/codetoanalyze/objcpp/frontend/funcoverloading/{af_test.dot => af_test.mm.dot} (100%) delete mode 100644 infer/tests/frontend/BUCK delete mode 100644 infer/tests/frontend/objc/ArcExampleTest.java delete mode 100644 infer/tests/frontend/objc/BlockTest.java delete mode 100644 infer/tests/frontend/objc/BoxingTest.java delete mode 100644 infer/tests/frontend/objc/CategoryTest.java delete mode 100644 infer/tests/frontend/objc/ConditionalOperatorTest.java delete mode 100644 infer/tests/frontend/objc/ExceptionTest.java delete mode 100644 infer/tests/frontend/objc/FastEnumerationTest.java delete mode 100644 infer/tests/frontend/objc/LateDefinedVarDeclTest.java delete mode 100644 infer/tests/frontend/objc/MallocTest.java delete mode 100644 infer/tests/frontend/objc/MemoryLeakBenchmarkTest.java delete mode 100644 infer/tests/frontend/objc/NSAssertTest.java delete mode 100644 infer/tests/frontend/objc/NonnullAttributeTest.java delete mode 100644 infer/tests/frontend/objc/PredefinedExpressionTest.java delete mode 100644 infer/tests/frontend/objc/PropertyTest.java delete mode 100644 infer/tests/frontend/objc/ProtocolTest.java delete mode 100644 infer/tests/frontend/objc/ReturnTest.java delete mode 100644 infer/tests/frontend/objc/StaticSelf.java delete mode 100644 infer/tests/frontend/objc/StringTest.java delete mode 100644 infer/tests/frontend/objc/SubclassTest.java delete mode 100644 infer/tests/frontend/objc/TypesTest.java delete mode 100644 infer/tests/frontend/objcpp/FuncOverloadingTest.java delete mode 100644 infer/tests/frontend/objcpp/GlobalConstTest.java delete mode 100644 infer/tests/utils/ClangFrontendUtils.java diff --git a/.buckconfig b/.buckconfig index ecce14977..584977746 100644 --- a/.buckconfig +++ b/.buckconfig @@ -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 diff --git a/Makefile b/Makefile index 1944faedf..b5ea36499 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/infer/tests/BUCK b/infer/tests/BUCK deleted file mode 100644 index 47e696db7..000000000 --- a/infer/tests/BUCK +++ /dev/null @@ -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', - ], -) diff --git a/infer/tests/codetoanalyze/Makefile.frontend b/infer/tests/codetoanalyze/Makefile.frontend index 0998e7b1a..df2030f0f 100644 --- a/infer/tests/codetoanalyze/Makefile.frontend +++ b/infer/tests/codetoanalyze/Makefile.frontend @@ -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 diff --git a/infer/tests/codetoanalyze/objc/errors/Makefile b/infer/tests/codetoanalyze/objc/errors/Makefile index 7330151d5..445aebd01 100644 --- a/infer/tests/codetoanalyze/objc/errors/Makefile +++ b/infer/tests/codetoanalyze/objc/errors/Makefile @@ -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 = \ diff --git a/infer/tests/codetoanalyze/objc/errors/category_procdesc/EOCPerson.dot b/infer/tests/codetoanalyze/objc/errors/category_procdesc/EOCPerson.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/category_procdesc/EOCPerson.dot rename to infer/tests/codetoanalyze/objc/errors/category_procdesc/EOCPerson.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot b/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot rename to infer/tests/codetoanalyze/objc/errors/category_procdesc/main.c.dot diff --git a/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot b/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot rename to infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.m.dot similarity index 95% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.m.dot index ea4a2bff4..ec5cadec7 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.m.dot @@ -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"] diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot rename to infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/npe/NPD_core_foundation.dot b/infer/tests/codetoanalyze/objc/errors/npe/NPD_core_foundation.dot deleted file mode 100644 index e8fdee618..000000000 --- a/infer/tests/codetoanalyze/objc/errors/npe/NPD_core_foundation.dot +++ /dev/null @@ -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 ; -} diff --git a/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot b/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot rename to infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.dot b/infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.dot rename to infer/tests/codetoanalyze/objc/errors/npe/npe_malloc.m.dot diff --git a/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot b/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot rename to infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.c.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/Makefile b/infer/tests/codetoanalyze/objc/frontend/Makefile new file mode 100644 index 000000000..d11a574b6 --- /dev/null +++ b/infer/tests/codetoanalyze/objc/frontend/Makefile @@ -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) + + + diff --git a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m.dot similarity index 92% rename from infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot rename to infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m.dot index e7cd40f04..669d2b4c2 100644 --- a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot +++ b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.m.dot @@ -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"] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot b/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot rename to infer/tests/codetoanalyze/objc/frontend/block/BlockVar.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot b/infer/tests/codetoanalyze/objc/frontend/block/block-it.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/block-it.dot rename to infer/tests/codetoanalyze/objc/frontend/block/block-it.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block.dot b/infer/tests/codetoanalyze/objc/frontend/block/block.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/block.dot rename to infer/tests/codetoanalyze/objc/frontend/block/block.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block_no_args.dot b/infer/tests/codetoanalyze/objc/frontend/block/block_no_args.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/block_no_args.dot rename to infer/tests/codetoanalyze/objc/frontend/block/block_no_args.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block_release.dot b/infer/tests/codetoanalyze/objc/frontend/block/block_release.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/block_release.dot rename to infer/tests/codetoanalyze/objc/frontend/block/block_release.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot rename to infer/tests/codetoanalyze/objc/frontend/block/dispatch.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot rename to infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot b/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot rename to infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/block/static.dot b/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/block/static.dot rename to infer/tests/codetoanalyze/objc/frontend/block/static.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot rename to infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/array.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/array.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/boxing/array.dot rename to infer/tests/codetoanalyze/objc/frontend/boxing/array.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot rename to infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.c.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot rename to infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.c.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/string_literal.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/string_literal.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/boxing/string_literal.dot rename to infer/tests/codetoanalyze/objc/frontend/boxing/string_literal.c.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot rename to infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot rename to infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m index 094112117..dcf5934d2 100644 --- a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m +++ b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m @@ -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; diff --git a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot similarity index 92% rename from infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot rename to infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot index 31fa49a84..628798e3d 100644 --- a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot +++ b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot @@ -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 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/link_to_errors b/infer/tests/codetoanalyze/objc/frontend/link_to_errors new file mode 120000 index 000000000..96cb529cb --- /dev/null +++ b/infer/tests/codetoanalyze/objc/frontend/link_to_errors @@ -0,0 +1 @@ +../errors/ \ No newline at end of file diff --git a/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.dot b/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.dot rename to infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.m.dot similarity index 93% rename from infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot rename to infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.m.dot index 3feeb71a1..78fb31257 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.m.dot @@ -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 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.dot rename to infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.dot rename to infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot rename to infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property/aclass.dot b/infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property/aclass.dot rename to infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property/main_car.dot b/infer/tests/codetoanalyze/objc/frontend/property/main_car.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property/main_car.dot rename to infer/tests/codetoanalyze/objc/frontend/property/main_car.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.dot b/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.dot rename to infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot rename to infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.dot b/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.dot rename to infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot rename to infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/static.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/self_static/static.dot rename to infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/strings/global_string_literal.dot b/infer/tests/codetoanalyze/objc/frontend/strings/global_string_literal.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/strings/global_string_literal.dot rename to infer/tests/codetoanalyze/objc/frontend/strings/global_string_literal.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/strings/string_literal.dot b/infer/tests/codetoanalyze/objc/frontend/strings/string_literal.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/strings/string_literal.dot rename to infer/tests/codetoanalyze/objc/frontend/strings/string_literal.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/A.m b/infer/tests/codetoanalyze/objc/frontend/subclass/A.m index 67d6d6752..9881080a5 100644 --- a/infer/tests/codetoanalyze/objc/frontend/subclass/A.m +++ b/infer/tests/codetoanalyze/objc/frontend/subclass/A.m @@ -9,6 +9,11 @@ #import +@interface A : NSObject { + int x; +} +@end + @implementation A - (instancetype)init { diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.dot rename to infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot rename to infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/main.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/main.c.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/subclass/main.dot rename to infer/tests/codetoanalyze/objc/frontend/subclass/main.c.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/types/attributes.dot b/infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/types/attributes.dot rename to infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/types/testloop.dot b/infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/types/testloop.dot rename to infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/types/void_call.dot b/infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/types/void_call.dot rename to infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.dot rename to infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.dot rename to infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot rename to infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/last_af.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/last_af.m.dot similarity index 100% rename from infer/tests/codetoanalyze/objc/frontend/vardecl/last_af.dot rename to infer/tests/codetoanalyze/objc/frontend/vardecl/last_af.m.dot diff --git a/infer/tests/codetoanalyze/objcpp/frontend/Makefile b/infer/tests/codetoanalyze/objcpp/frontend/Makefile new file mode 100644 index 000000000..4fca3817a --- /dev/null +++ b/infer/tests/codetoanalyze/objcpp/frontend/Makefile @@ -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) + + + diff --git a/infer/tests/codetoanalyze/objcpp/frontend/funcoverloading/af_test.dot b/infer/tests/codetoanalyze/objcpp/frontend/funcoverloading/af_test.mm.dot similarity index 100% rename from infer/tests/codetoanalyze/objcpp/frontend/funcoverloading/af_test.dot rename to infer/tests/codetoanalyze/objcpp/frontend/funcoverloading/af_test.mm.dot diff --git a/infer/tests/endtoend/BUCK b/infer/tests/endtoend/BUCK index 18193d9e3..875c2e756 100644 --- a/infer/tests/endtoend/BUCK +++ b/infer/tests/endtoend/BUCK @@ -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', ], diff --git a/infer/tests/frontend/BUCK b/infer/tests/frontend/BUCK deleted file mode 100644 index da2708ce2..000000000 --- a/infer/tests/frontend/BUCK +++ /dev/null @@ -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, -) diff --git a/infer/tests/frontend/objc/ArcExampleTest.java b/infer/tests/frontend/objc/ArcExampleTest.java deleted file mode 100644 index 7f4921df2..000000000 --- a/infer/tests/frontend/objc/ArcExampleTest.java +++ /dev/null @@ -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 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 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 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)); - } -} diff --git a/infer/tests/frontend/objc/BlockTest.java b/infer/tests/frontend/objc/BlockTest.java deleted file mode 100644 index 638cc29bd..000000000 --- a/infer/tests/frontend/objc/BlockTest.java +++ /dev/null @@ -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 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 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 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 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 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 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 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 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 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)); - } - - -} diff --git a/infer/tests/frontend/objc/BoxingTest.java b/infer/tests/frontend/objc/BoxingTest.java deleted file mode 100644 index 97ccea056..000000000 --- a/infer/tests/frontend/objc/BoxingTest.java +++ /dev/null @@ -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 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 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 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 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 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)); - } - -} diff --git a/infer/tests/frontend/objc/CategoryTest.java b/infer/tests/frontend/objc/CategoryTest.java deleted file mode 100644 index 372683d93..000000000 --- a/infer/tests/frontend/objc/CategoryTest.java +++ /dev/null @@ -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 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 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)); - } -} diff --git a/infer/tests/frontend/objc/ConditionalOperatorTest.java b/infer/tests/frontend/objc/ConditionalOperatorTest.java deleted file mode 100644 index dd6fbf1fb..000000000 --- a/infer/tests/frontend/objc/ConditionalOperatorTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/ExceptionTest.java b/infer/tests/frontend/objc/ExceptionTest.java deleted file mode 100644 index f9977ca22..000000000 --- a/infer/tests/frontend/objc/ExceptionTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/FastEnumerationTest.java b/infer/tests/frontend/objc/FastEnumerationTest.java deleted file mode 100644 index cd9a159ee..000000000 --- a/infer/tests/frontend/objc/FastEnumerationTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/LateDefinedVarDeclTest.java b/infer/tests/frontend/objc/LateDefinedVarDeclTest.java deleted file mode 100644 index f12e74cee..000000000 --- a/infer/tests/frontend/objc/LateDefinedVarDeclTest.java +++ /dev/null @@ -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 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 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 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)); - } -} diff --git a/infer/tests/frontend/objc/MallocTest.java b/infer/tests/frontend/objc/MallocTest.java deleted file mode 100644 index 04102e898..000000000 --- a/infer/tests/frontend/objc/MallocTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/MemoryLeakBenchmarkTest.java b/infer/tests/frontend/objc/MemoryLeakBenchmarkTest.java deleted file mode 100644 index bcad8dcdc..000000000 --- a/infer/tests/frontend/objc/MemoryLeakBenchmarkTest.java +++ /dev/null @@ -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 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 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 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 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 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)); - } -} diff --git a/infer/tests/frontend/objc/NSAssertTest.java b/infer/tests/frontend/objc/NSAssertTest.java deleted file mode 100644 index 928bf492b..000000000 --- a/infer/tests/frontend/objc/NSAssertTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/NonnullAttributeTest.java b/infer/tests/frontend/objc/NonnullAttributeTest.java deleted file mode 100644 index 82f141946..000000000 --- a/infer/tests/frontend/objc/NonnullAttributeTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/PredefinedExpressionTest.java b/infer/tests/frontend/objc/PredefinedExpressionTest.java deleted file mode 100644 index 14b524615..000000000 --- a/infer/tests/frontend/objc/PredefinedExpressionTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objc/PropertyTest.java b/infer/tests/frontend/objc/PropertyTest.java deleted file mode 100644 index ad0f71a12..000000000 --- a/infer/tests/frontend/objc/PropertyTest.java +++ /dev/null @@ -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 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 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 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 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 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 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 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)); - } - - - -} diff --git a/infer/tests/frontend/objc/ProtocolTest.java b/infer/tests/frontend/objc/ProtocolTest.java deleted file mode 100644 index f31351123..000000000 --- a/infer/tests/frontend/objc/ProtocolTest.java +++ /dev/null @@ -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 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 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)); - } - -} diff --git a/infer/tests/frontend/objc/ReturnTest.java b/infer/tests/frontend/objc/ReturnTest.java deleted file mode 100644 index ecd09ab59..000000000 --- a/infer/tests/frontend/objc/ReturnTest.java +++ /dev/null @@ -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 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)); - } - -} diff --git a/infer/tests/frontend/objc/StaticSelf.java b/infer/tests/frontend/objc/StaticSelf.java deleted file mode 100644 index a90930c45..000000000 --- a/infer/tests/frontend/objc/StaticSelf.java +++ /dev/null @@ -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 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 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 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)); - } - - -} diff --git a/infer/tests/frontend/objc/StringTest.java b/infer/tests/frontend/objc/StringTest.java deleted file mode 100644 index f5bd3f9fb..000000000 --- a/infer/tests/frontend/objc/StringTest.java +++ /dev/null @@ -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 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 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)); - } -} diff --git a/infer/tests/frontend/objc/SubclassTest.java b/infer/tests/frontend/objc/SubclassTest.java deleted file mode 100644 index b1b6878bd..000000000 --- a/infer/tests/frontend/objc/SubclassTest.java +++ /dev/null @@ -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 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 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 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)); - } - - -} diff --git a/infer/tests/frontend/objc/TypesTest.java b/infer/tests/frontend/objc/TypesTest.java deleted file mode 100644 index 0812fd160..000000000 --- a/infer/tests/frontend/objc/TypesTest.java +++ /dev/null @@ -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 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 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 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)); - } -} diff --git a/infer/tests/frontend/objcpp/FuncOverloadingTest.java b/infer/tests/frontend/objcpp/FuncOverloadingTest.java deleted file mode 100644 index 15b5e52f0..000000000 --- a/infer/tests/frontend/objcpp/FuncOverloadingTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/frontend/objcpp/GlobalConstTest.java b/infer/tests/frontend/objcpp/GlobalConstTest.java deleted file mode 100644 index 72b487c13..000000000 --- a/infer/tests/frontend/objcpp/GlobalConstTest.java +++ /dev/null @@ -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 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)); - } -} diff --git a/infer/tests/utils/ClangFrontendUtils.java b/infer/tests/utils/ClangFrontendUtils.java deleted file mode 100644 index f096f7ab2..000000000 --- a/infer/tests/utils/ClangFrontendUtils.java +++ /dev/null @@ -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 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 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)); - } -} diff --git a/infer/tests/utils/InferRunner.java b/infer/tests/utils/InferRunner.java index 5f83aa851..e1c7e2c49 100644 --- a/infer/tests/utils/InferRunner.java +++ b/infer/tests/utils/InferRunner.java @@ -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 inferResultsMap = new HashMap(); @@ -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 createClangCommand( - String sourceFile, - Language lang, - @Nullable String isysroot, - boolean arc) { - ImmutableList.Builder 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 arcOption = - new ImmutableList.Builder<>(); - if (arc) { - arcOption.add("-fobjc-arc"); - } - ImmutableList clangCmd = new ImmutableList.Builder() - .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 createClangInferCommand( - TemporaryFolder folder, - String sourceFile, - Language lang, - @Nullable String isysroot, - boolean arc, - ImmutableList inferOptions) { - File resultsDir = createResultsDir(folder); - String resultsDirName = resultsDir.getAbsolutePath(); - InferRunner.bugsFile = new File(resultsDir, BUGS_FILE_NAME); - - return new ImmutableList.Builder() - .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 createClangInferCommand( - TemporaryFolder folder, - String sourceFile, - Language lang, - String analyzer, - @Nullable String isysroot, - @Nullable String ml_buckets, - boolean arc, - ImmutableList extraInferOptions) { - ImmutableList.Builder inferOptionsBuilder = new ImmutableList.Builder() - .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 createCInferCommandFrontend( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) { - return createClangInferCommand( - folder, - sourceFile, - Language.C, - "capture", - null, - null, - false, - extraInferOptions); - } - - public static ImmutableList createCInferCommandFrontend( - TemporaryFolder folder, - String sourceFile) { - return createCInferCommandFrontend(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createCPPInferCommandFrontend( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) { - return createClangInferCommand( - folder, - sourceFile, - Language.CPP, - "capture", - null, - null, - false, - extraInferOptions); - } - - public static ImmutableList createCPPInferCommandFrontend( - TemporaryFolder folder, - String sourceFile) { - return createCPPInferCommandFrontend(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createObjCInferCommandFrontend( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjC, - "capture", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - extraInferOptions); - } - - public static ImmutableList createObjCInferCommandFrontend( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createObjCInferCommandFrontend(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createObjCInferCommandFrontendArc( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjC, - "capture", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - true, - extraInferOptions); - } - - public static ImmutableList createObjCInferCommandFrontendArc( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createObjCInferCommandFrontendArc(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createObjCPPInferCommandFrontend( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjCPP, - "capture", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - extraInferOptions); - } - - public static ImmutableList createObjCPPInferCommandFrontend( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createObjCPPInferCommandFrontend(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createCInferCommand( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) { - return createClangInferCommand( - folder, - sourceFile, - Language.C, - "infer", - null, - null, - false, - extraInferOptions); - } - - public static ImmutableList createCInferCommand( - TemporaryFolder folder, - String sourceFile) { - return createCInferCommand(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createCPPInferCommand( - TemporaryFolder folder, - String sourceFile, - ImmutableList extraInferOptions) { - ImmutableList args = new ImmutableList.Builder () - .add("--no-testing-mode") - .addAll(extraInferOptions) - .build(); - return createClangInferCommand( - folder, - sourceFile, - Language.CPP, - "infer", - null, - null, - false, - args); - } - - public static ImmutableList createCPPInferCommand( - TemporaryFolder folder, - String sourceFile) { - return createCPPInferCommand(folder, sourceFile, ImmutableList.of()); - } - - public static ImmutableList createCPPInferCommandIncludeHeaders( - TemporaryFolder folder, - String sourceFile) { - return createCPPInferCommand( - folder, - sourceFile, - ImmutableList.of("--testing-mode", "--headers")); - } - - public static ImmutableList createCPPInferCommandWithMLBuckets( - TemporaryFolder folder, - String sourceFile, - String ml_bucket) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.CPP, - "infer", - null, - ml_bucket, - false, - ImmutableList.of()); - } - - public static ImmutableList createObjCInferCommand( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjC, - "infer", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - ImmutableList.of()); - } - - public static ImmutableList 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.of()); - } - - public static ImmutableList createObjCPPInferCommand( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjCPP, - "infer", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - ImmutableList.of()); - } - - public static ImmutableList createiOSInferCommandFrontend( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjC, - "infer", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - ImmutableList.of()); - } - - public static ImmutableList createiOSInferCommand( - TemporaryFolder folder, - String sourceFile) throws IOException, InterruptedException { - return createClangInferCommand( - folder, - sourceFile, - Language.ObjC, - "infer", - getXcodeRoot() + IPHONESIMULATOR_ISYSROOT_SUFFIX, - null, - false, - ImmutableList.of()); - } - - public static ImmutableList 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.of()); - } - - @Nullable - public static File runInferFrontend(ImmutableList inferCmd) - throws IOException, InterruptedException, InferException { - runCommand(inferCmd, TestType.FRONTEND); - return dotFile; - } - private static InferResults runInfer( ImmutableList inferCmd, Language lang)