setup e2e test skeleton

Reviewed By: cristianoc

Differential Revision: D3806745

fbshipit-source-id: c73e5cb
master
Sam Blackshear 8 years ago committed by Facebook Github Bot 2
parent 91071af3ad
commit 3ff6622c9c

@ -15,7 +15,7 @@ TARGETS_TO_TEST += c cpp
endif endif
ifeq ($(BUILD_JAVA_ANALYZERS),yes) ifeq ($(BUILD_JAVA_ANALYZERS),yes)
TARGETS_TO_TEST += java TARGETS_TO_TEST += java
DIRECT_TESTS += java_checkers_test java_eradicate_test java_infer_test java_tracing_test DIRECT_TESTS += java_checkers_test java_eradicate_test java_infer_test java_tracing_test java_quandary_test
endif endif
ifneq ($(XCODE_SELECT),no) ifneq ($(XCODE_SELECT),no)
TARGETS_TO_TEST += objc objcpp TARGETS_TO_TEST += objc objcpp
@ -109,6 +109,8 @@ java_infer_test:
java_tracing_test: java_tracing_test:
make -C ./infer/tests/codetoanalyze/java/tracing test make -C ./infer/tests/codetoanalyze/java/tracing test
java_quandary_test:
make -C ./infer/tests/codetoanalyze/java/quandary test
buck_test: infer buck_test: infer
make $(DIRECT_TESTS) make $(DIRECT_TESTS)

@ -19,10 +19,12 @@ MODELS = $(JAVA_LIB_DIR)/models.jar
CLASSPATH=$(ANDROID19):$(ANDROIDSUPPORT):$(ANNOTATIONS):$(BUTTERKNIFE):$(JACKSON):$(JSR305):$(INJECT):$(MODELS):. CLASSPATH=$(ANDROID19):$(ANDROIDSUPPORT):$(ANNOTATIONS):$(BUTTERKNIFE):$(JACKSON):$(JSR305):$(INJECT):$(MODELS):.
INFERPRINT_OPTIONS = --issues-tests
default: compile default: compile
print: analyze print: analyze
$(INFERPRINT_BIN) -q -a $(ANALYZER) --issues-tests issues.exp.test $(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) issues.exp.test
LC_ALL=C sort -o issues.exp.test issues.exp.test LC_ALL=C sort -o issues.exp.test issues.exp.test
test: analyze print test: analyze print

@ -0,0 +1,29 @@
/*
* 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 codetoanalyze.java.quandary;
import android.content.SharedPreferences;
import android.util.Log;
public class LoggingPrivateData {
public void logSharedPreferencesDataBad(SharedPreferences prefs) {
Log.d("tag", prefs.getString("some", "data"));
}
public void logSharedPreferencesDataInTagBad(SharedPreferences prefs) {
Log.d(prefs.getString("some", "data"), "value");
}
public void logDataOk(SharedPreferences prefs) {
Log.d("tag", "value");
}
}

@ -0,0 +1,20 @@
# 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
ANALYZER = quandary
INFERPRINT_OPTIONS = --issues-txt
FILES = \
LoggingPrivateData.java \
compile:
javac -cp $(CLASSPATH) $(FILES)
analyze:
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null

@ -0,0 +1,2 @@
LoggingPrivateData.java:18: ERROR: QUANDARY_TAINT_ERROR Error: SharedPreferences(String SharedPreferences.getString(String,String) at [line 18]) -> Logging(int Log.d(String,String) at [line 18]) via { }
LoggingPrivateData.java:22: ERROR: QUANDARY_TAINT_ERROR Error: SharedPreferences(String SharedPreferences.getString(String,String) at [line 22]) -> Logging(int Log.d(String,String) at [line 22]) via { }
Loading…
Cancel
Save