From 9282e30d7258db3c690586afb78185bae87bf6e7 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Thu, 12 Oct 2017 10:03:17 -0700 Subject: [PATCH] [infer][checkers] move the tests for the lab in it own directory Summary: We will then be able to merge the tests for the other checkers without affecting these lab tests Reviewed By: jvillard Differential Revision: D6039433 fbshipit-source-id: e575ce9 --- Makefile | 4 ++-- .../tests/codetoanalyze/java/checkers/issues.exp | 3 --- .../java/{checkers => lab}/Leaks.java | 0 infer/tests/codetoanalyze/java/lab/Makefile | 15 +++++++++++++++ infer/tests/codetoanalyze/java/lab/issues.exp | 3 +++ 5 files changed, 20 insertions(+), 5 deletions(-) rename infer/tests/codetoanalyze/java/{checkers => lab}/Leaks.java (100%) create mode 100644 infer/tests/codetoanalyze/java/lab/Makefile create mode 100644 infer/tests/codetoanalyze/java/lab/issues.exp 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, []