From 9199aa4b24bf36dfcbbabed3f6bc6ee9d759e457 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 15 Jan 2020 06:06:38 -0800 Subject: [PATCH] [topl] split tests Summary: add subdirectories so that we can run each java file against its own topl properties Reviewed By: rgrig Differential Revision: D19347302 fbshipit-source-id: 562830774 --- infer/tests/codetoanalyze/java/topl/Makefile | 18 ++++++++++++++---- .../java/topl/{ => hasnext}/Iterators.java | 0 .../codetoanalyze/java/topl/hasnext/Makefile | 13 +++++++++++++ .../java/topl/{ => hasnext}/ScannerFail.java | 0 .../java/topl/{ => hasnext}/hasnext.topl | 0 .../codetoanalyze/java/topl/hasnext/issues.exp | 7 +++++++ infer/tests/codetoanalyze/java/topl/issues.exp | 8 -------- .../java/topl/{ => skip}/IndexSkip.java | 0 .../codetoanalyze/java/topl/skip/Makefile | 13 +++++++++++++ .../java/topl/{ => skip}/SkipAfterRemove.topl | 0 .../codetoanalyze/java/topl/skip/issues.exp | 0 .../codetoanalyze/java/topl/tomcat/Makefile | 13 +++++++++++++ .../java/topl/{ => tomcat}/TomcatFail.java | 0 .../codetoanalyze/java/topl/tomcat/issues.exp | 0 .../java/topl/{ => tomcat}/tomcat.topl | 0 15 files changed, 60 insertions(+), 12 deletions(-) rename infer/tests/codetoanalyze/java/topl/{ => hasnext}/Iterators.java (100%) create mode 100644 infer/tests/codetoanalyze/java/topl/hasnext/Makefile rename infer/tests/codetoanalyze/java/topl/{ => hasnext}/ScannerFail.java (100%) rename infer/tests/codetoanalyze/java/topl/{ => hasnext}/hasnext.topl (100%) create mode 100644 infer/tests/codetoanalyze/java/topl/hasnext/issues.exp delete mode 100644 infer/tests/codetoanalyze/java/topl/issues.exp rename infer/tests/codetoanalyze/java/topl/{ => skip}/IndexSkip.java (100%) create mode 100644 infer/tests/codetoanalyze/java/topl/skip/Makefile rename infer/tests/codetoanalyze/java/topl/{ => skip}/SkipAfterRemove.topl (100%) create mode 100644 infer/tests/codetoanalyze/java/topl/skip/issues.exp create mode 100644 infer/tests/codetoanalyze/java/topl/tomcat/Makefile rename infer/tests/codetoanalyze/java/topl/{ => tomcat}/TomcatFail.java (100%) create mode 100644 infer/tests/codetoanalyze/java/topl/tomcat/issues.exp rename infer/tests/codetoanalyze/java/topl/{ => tomcat}/tomcat.topl (100%) diff --git a/infer/tests/codetoanalyze/java/topl/Makefile b/infer/tests/codetoanalyze/java/topl/Makefile index 03a4a55a7..de10fc799 100644 --- a/infer/tests/codetoanalyze/java/topl/Makefile +++ b/infer/tests/codetoanalyze/java/topl/Makefile @@ -5,9 +5,19 @@ TESTS_DIR = ../../.. -INFER_OPTIONS = --seconds-per-iteration 100 --symops-per-iteration 10000 --topl-properties hasnext.topl --topl-properties SkipAfterRemove.topl --biabduction-only -INFERPRINT_OPTIONS = --issues-tests +SUBDIRS = hasnext skip tomcat -SOURCES = $(wildcard *.java) +test-%: + $(MAKE) -C $* test -include $(TESTS_DIR)/javac.make +test: $(SUBDIRS:%=test-%) + +replace-%: + $(MAKE) -C $* replace + +replace: $(SUBDIRS:%=replace-%) + +clean-%: + $(MAKE) -C $* clean + +clean: $(SUBDIRS:%=clean-%) diff --git a/infer/tests/codetoanalyze/java/topl/Iterators.java b/infer/tests/codetoanalyze/java/topl/hasnext/Iterators.java similarity index 100% rename from infer/tests/codetoanalyze/java/topl/Iterators.java rename to infer/tests/codetoanalyze/java/topl/hasnext/Iterators.java diff --git a/infer/tests/codetoanalyze/java/topl/hasnext/Makefile b/infer/tests/codetoanalyze/java/topl/hasnext/Makefile new file mode 100644 index 000000000..96be96b4a --- /dev/null +++ b/infer/tests/codetoanalyze/java/topl/hasnext/Makefile @@ -0,0 +1,13 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +TESTS_DIR = ../../../.. + +INFER_OPTIONS = --seconds-per-iteration 100 --symops-per-iteration 10000 --topl-properties hasnext.topl --biabduction-only +INFERPRINT_OPTIONS = --issues-tests + +SOURCES = $(wildcard *.java) + +include $(TESTS_DIR)/javac.make diff --git a/infer/tests/codetoanalyze/java/topl/ScannerFail.java b/infer/tests/codetoanalyze/java/topl/hasnext/ScannerFail.java similarity index 100% rename from infer/tests/codetoanalyze/java/topl/ScannerFail.java rename to infer/tests/codetoanalyze/java/topl/hasnext/ScannerFail.java diff --git a/infer/tests/codetoanalyze/java/topl/hasnext.topl b/infer/tests/codetoanalyze/java/topl/hasnext/hasnext.topl similarity index 100% rename from infer/tests/codetoanalyze/java/topl/hasnext.topl rename to infer/tests/codetoanalyze/java/topl/hasnext/hasnext.topl diff --git a/infer/tests/codetoanalyze/java/topl/hasnext/issues.exp b/infer/tests/codetoanalyze/java/topl/hasnext/issues.exp new file mode 100644 index 000000000..de2b067e2 --- /dev/null +++ b/infer/tests/codetoanalyze/java/topl/hasnext/issues.exp @@ -0,0 +1,7 @@ +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextBad(java.util.List):void, 0, TOPL_ERROR, no_bucket, ERROR, [] +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextBad(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextBad(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),return from a call to void Property.execute()] +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextInterproceduralBad(java.util.List):void, 0, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextInterproceduralBad(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),return from a call to void Property.execute(),start of procedure getSingleElementOk(...)] +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextInterproceduralBad(java.util.List):void, 0, TOPL_ERROR, no_bucket, ERROR, [] +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextInterproceduralOk(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextInterproceduralOk(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),return from a call to void Property.execute()] +codetoanalyze/java/topl/hasnext/Iterators.java, Iterators.hasNextOk(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextOk(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),return from a call to void Property.execute()] +codetoanalyze/java/topl/hasnext/ScannerFail.java, ScannerFail.readBad():void, 0, TOPL_ERROR, no_bucket, ERROR, [] diff --git a/infer/tests/codetoanalyze/java/topl/issues.exp b/infer/tests/codetoanalyze/java/topl/issues.exp deleted file mode 100644 index ee1be32f1..000000000 --- a/infer/tests/codetoanalyze/java/topl/issues.exp +++ /dev/null @@ -1,8 +0,0 @@ -codetoanalyze/java/topl/IndexSkip.java, IndexSkip.foo(java.util.ArrayList):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure foo(...),Taking true branch,Skipping get(...): unknown method,start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,ArrayList,Object),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),start of procedure execute_state_4(),Taking false branch,return from a call to void Property.execute_state_4(),start of procedure execute_state_5(),Taking false branch,return from a call to void Property.execute_state_5(),start of procedure execute_state_6(),Taking false branch,return from a call to void Property.execute_state_6(),start of procedure execute_state_7(),Taking false branch,return from a call to void Property.execute_state_7(),return from a call to void Property.execute()] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextBad(java.util.List):void, 0, TOPL_ERROR, no_bucket, ERROR, [] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextBad(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextBad(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),start of procedure execute_state_4(),Taking false branch,return from a call to void Property.execute_state_4(),start of procedure execute_state_5(),Taking false branch,return from a call to void Property.execute_state_5(),start of procedure execute_state_6(),Taking false branch,return from a call to void Property.execute_state_6(),start of procedure execute_state_7(),Taking false branch,return from a call to void Property.execute_state_7(),return from a call to void Property.execute()] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextInterproceduralBad(java.util.List):void, 0, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextInterproceduralBad(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),start of procedure execute_state_4(),Taking false branch,return from a call to void Property.execute_state_4(),start of procedure execute_state_5(),Taking false branch,return from a call to void Property.execute_state_5(),start of procedure execute_state_6(),Taking false branch,return from a call to void Property.execute_state_6(),start of procedure execute_state_7(),Taking false branch,return from a call to void Property.execute_state_7(),return from a call to void Property.execute(),start of procedure getSingleElementOk(...)] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextInterproceduralBad(java.util.List):void, 0, TOPL_ERROR, no_bucket, ERROR, [] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextInterproceduralOk(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextInterproceduralOk(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),start of procedure execute_state_4(),Taking false branch,return from a call to void Property.execute_state_4(),start of procedure execute_state_5(),Taking false branch,return from a call to void Property.execute_state_5(),start of procedure execute_state_6(),Taking false branch,return from a call to void Property.execute_state_6(),start of procedure execute_state_7(),Taking false branch,return from a call to void Property.execute_state_7(),return from a call to void Property.execute()] -codetoanalyze/java/topl/Iterators.java, Iterators.hasNextOk(java.util.List):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure hasNextOk(...),start of procedure saveArgs(...),return from a call to void Property.saveArgs(Object,List),start of procedure execute(),start of procedure execute_state_0(),Taking false branch,return from a call to void Property.execute_state_0(),start of procedure execute_state_1(),Taking true branch,Taking false branch,Taking false branch,return from a call to void Property.execute_state_1(),start of procedure execute_state_2(),Taking false branch,return from a call to void Property.execute_state_2(),start of procedure execute_state_3(),Taking false branch,return from a call to void Property.execute_state_3(),start of procedure execute_state_4(),Taking false branch,return from a call to void Property.execute_state_4(),start of procedure execute_state_5(),Taking false branch,return from a call to void Property.execute_state_5(),start of procedure execute_state_6(),Taking false branch,return from a call to void Property.execute_state_6(),start of procedure execute_state_7(),Taking false branch,return from a call to void Property.execute_state_7(),return from a call to void Property.execute()] -codetoanalyze/java/topl/ScannerFail.java, ScannerFail.readBad():void, 0, TOPL_ERROR, no_bucket, ERROR, [] diff --git a/infer/tests/codetoanalyze/java/topl/IndexSkip.java b/infer/tests/codetoanalyze/java/topl/skip/IndexSkip.java similarity index 100% rename from infer/tests/codetoanalyze/java/topl/IndexSkip.java rename to infer/tests/codetoanalyze/java/topl/skip/IndexSkip.java diff --git a/infer/tests/codetoanalyze/java/topl/skip/Makefile b/infer/tests/codetoanalyze/java/topl/skip/Makefile new file mode 100644 index 000000000..d168933ce --- /dev/null +++ b/infer/tests/codetoanalyze/java/topl/skip/Makefile @@ -0,0 +1,13 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +TESTS_DIR = ../../../.. + +INFER_OPTIONS = --seconds-per-iteration 100 --symops-per-iteration 10000 --topl-properties SkipAfterRemove.topl --biabduction-only +INFERPRINT_OPTIONS = --issues-tests + +SOURCES = $(wildcard *.java) + +include $(TESTS_DIR)/javac.make diff --git a/infer/tests/codetoanalyze/java/topl/SkipAfterRemove.topl b/infer/tests/codetoanalyze/java/topl/skip/SkipAfterRemove.topl similarity index 100% rename from infer/tests/codetoanalyze/java/topl/SkipAfterRemove.topl rename to infer/tests/codetoanalyze/java/topl/skip/SkipAfterRemove.topl diff --git a/infer/tests/codetoanalyze/java/topl/skip/issues.exp b/infer/tests/codetoanalyze/java/topl/skip/issues.exp new file mode 100644 index 000000000..e69de29bb diff --git a/infer/tests/codetoanalyze/java/topl/tomcat/Makefile b/infer/tests/codetoanalyze/java/topl/tomcat/Makefile new file mode 100644 index 000000000..d1571df48 --- /dev/null +++ b/infer/tests/codetoanalyze/java/topl/tomcat/Makefile @@ -0,0 +1,13 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +TESTS_DIR = ../../../.. + +INFER_OPTIONS = --seconds-per-iteration 100 --symops-per-iteration 10000 --topl-properties tomcat.topl --biabduction-only +INFERPRINT_OPTIONS = --issues-tests + +SOURCES = $(wildcard *.java) + +include $(TESTS_DIR)/javac.make diff --git a/infer/tests/codetoanalyze/java/topl/TomcatFail.java b/infer/tests/codetoanalyze/java/topl/tomcat/TomcatFail.java similarity index 100% rename from infer/tests/codetoanalyze/java/topl/TomcatFail.java rename to infer/tests/codetoanalyze/java/topl/tomcat/TomcatFail.java diff --git a/infer/tests/codetoanalyze/java/topl/tomcat/issues.exp b/infer/tests/codetoanalyze/java/topl/tomcat/issues.exp new file mode 100644 index 000000000..e69de29bb diff --git a/infer/tests/codetoanalyze/java/topl/tomcat.topl b/infer/tests/codetoanalyze/java/topl/tomcat/tomcat.topl similarity index 100% rename from infer/tests/codetoanalyze/java/topl/tomcat.topl rename to infer/tests/codetoanalyze/java/topl/tomcat/tomcat.topl