diff --git a/Makefile b/Makefile index 482dbec94..6d0eb06c3 100644 --- a/Makefile +++ b/Makefile @@ -83,8 +83,8 @@ BUILD_SYSTEMS_TESTS += \ resource_leak_exception_lines \ DIRECT_TESTS += \ - java_checkers java_eradicate java_infer java_tracing java_quandary java_threadsafety \ - java_crashcontext java_harness + java_checkers java_eradicate java_infer java_lab java_tracing java_quandary \ + java_threadsafety java_crashcontext java_harness ifneq ($(ANT),no) BUILD_SYSTEMS_TESTS += ant endif diff --git a/infer/tests/codetoanalyze/java/checkers/issues.exp b/infer/tests/codetoanalyze/java/checkers/issues.exp index a61115c81..e58faa843 100644 --- a/infer/tests/codetoanalyze/java/checkers/issues.exp +++ b/infer/tests/codetoanalyze/java/checkers/issues.exp @@ -31,9 +31,6 @@ codetoanalyze/java/checkers/FragmentRetainsViewExample.java, void FragmentRetain codetoanalyze/java/checkers/FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW, [return from a call to void FragmentRetainsViewExample.onDestroyView()] codetoanalyze/java/checkers/ImmutableCast.java, List ImmutableCast.badCast(ImmutableList), 0, CHECKERS_IMMUTABLE_CAST, [Method badCast(...) returns class com.google.common.collect.ImmutableList but the return type is class java.util.List. Make sure that users of this method do not try to modify the collection.] codetoanalyze/java/checkers/ImmutableCast.java, List ImmutableCast.badCastFromField(), 0, CHECKERS_IMMUTABLE_CAST, [Method badCastFromField() returns class com.google.common.collect.ImmutableList but the return type is class java.util.List. Make sure that users of this method do not try to modify the collection.] -codetoanalyze/java/checkers/Leaks.java, void Leaks.acquireTwoForgetOneBad(), 4, RESOURCE_LEAK, [] -codetoanalyze/java/checkers/Leaks.java, void Leaks.basicLeakBad(), 2, RESOURCE_LEAK, [] -codetoanalyze/java/checkers/Leaks.java, void Leaks.doubleLeakBad(), 3, RESOURCE_LEAK, [] codetoanalyze/java/checkers/NoAllocationExample.java, void NoAllocationExample.directlyAllocatingMethod(), 1, CHECKERS_ALLOCATES_MEMORY, [] codetoanalyze/java/checkers/NoAllocationExample.java, void NoAllocationExample.indirectlyAllocatingMethod(), 1, CHECKERS_ALLOCATES_MEMORY, [] codetoanalyze/java/checkers/NullableSuggest.java, void NullableSuggest.assignNullBad(), 1, FIELD_SHOULD_BE_NULLABLE, [Field obj0 is assigned null here] diff --git a/infer/tests/codetoanalyze/java/checkers/Leaks.java b/infer/tests/codetoanalyze/java/lab/Leaks.java similarity index 100% rename from infer/tests/codetoanalyze/java/checkers/Leaks.java rename to infer/tests/codetoanalyze/java/lab/Leaks.java diff --git a/infer/tests/codetoanalyze/java/lab/Makefile b/infer/tests/codetoanalyze/java/lab/Makefile new file mode 100644 index 000000000..5d60a4d62 --- /dev/null +++ b/infer/tests/codetoanalyze/java/lab/Makefile @@ -0,0 +1,15 @@ +# 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. + +TESTS_DIR = ../../.. + +ANALYZER = checkers +INFER_OPTIONS = --debug-exceptions --no-default-checkers --resource-leak +INFERPRINT_OPTIONS = --issues-tests +SOURCES = $(wildcard *.java) + +include $(TESTS_DIR)/javac.make diff --git a/infer/tests/codetoanalyze/java/lab/issues.exp b/infer/tests/codetoanalyze/java/lab/issues.exp new file mode 100644 index 000000000..bc838069a --- /dev/null +++ b/infer/tests/codetoanalyze/java/lab/issues.exp @@ -0,0 +1,3 @@ +codetoanalyze/java/lab/Leaks.java, void Leaks.acquireTwoForgetOneBad(), 4, RESOURCE_LEAK, [] +codetoanalyze/java/lab/Leaks.java, void Leaks.basicLeakBad(), 2, RESOURCE_LEAK, [] +codetoanalyze/java/lab/Leaks.java, void Leaks.doubleLeakBad(), 3, RESOURCE_LEAK, []