diff --git a/.gitignore b/.gitignore index 26219627a..6eca1307e 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ duplicates.txt /infer/tests/build_systems/diff_*/src /infer/tests/build_systems/differential_*/**/*.class /infer/tests/build_systems/differential_*/**/Diff*.java +/infer/tests/build_systems/differential_*/**/Diff*.m /infer/tests/build_systems/incremental_analysis_remove_file/src /infer/tests/build_systems/incremental_analysis_cost_change/src /infer/tests/build_systems/incremental_analysis_add_procedure/src diff --git a/infer/tests/build_systems/differential_of_costs_report_java/Makefile b/infer/tests/build_systems/differential_of_costs_report_java/Makefile index 1727936bd..2d0316125 100644 --- a/infer/tests/build_systems/differential_of_costs_report_java/Makefile +++ b/infer/tests/build_systems/differential_of_costs_report_java/Makefile @@ -6,8 +6,9 @@ # E2E test for differential of costs TESTS_DIR = ../.. -SOURCES = src/DiffExample.java.current src/DiffExample.java.previous src/DiffExampleUIThread.java.current src/DiffExampleUIThread.java.previous -CLEAN_EXTRA = src/Diff*.java *.class +SOURCES = src/DiffExample.current.java src/DiffExample.previous.java src/DiffExampleUIThread.current.java src/DiffExampleUIThread.previous.java +COPIED = src/DiffExample.java src/DiffExampleUIThread.java +CLEAN_EXTRA = $(COPIED) *.class include $(TESTS_DIR)/differential.make include $(TESTS_DIR)/java.make INFERPRINT_ISSUES_FIELDS = \ @@ -16,13 +17,13 @@ INFERPRINT_ISSUES_FIELDS = \ $(CURRENT_REPORT) $(PREVIOUS_REPORT): $(JAVA_DEPS) $(CURRENT_REPORT): - $(QUIET)$(COPY) src/DiffExample.java.current src/DiffExample.java - $(QUIET)$(COPY) src/DiffExampleUIThread.java.current src/DiffExampleUIThread.java + $(QUIET)$(COPY) src/DiffExample.current.java src/DiffExample.java + $(QUIET)$(COPY) src/DiffExampleUIThread.current.java src/DiffExampleUIThread.java $(QUIET)$(call silent_on_success,Testing Cost Differential: current,\ - $(INFER_BIN) --no-filtering --cost-only -o $(CURRENT_DIR) -- $(JAVAC) -cp $(CLASSPATH) src/*.java) + $(INFER_BIN) --no-filtering --cost-only -o $(CURRENT_DIR) -- $(JAVAC) -cp $(CLASSPATH) $(COPIED)) $(PREVIOUS_REPORT): - $(QUIET)$(COPY) src/DiffExample.java.previous src/DiffExample.java - $(QUIET)$(COPY) src/DiffExampleUIThread.java.previous src/DiffExampleUIThread.java + $(QUIET)$(COPY) src/DiffExample.previous.java src/DiffExample.java + $(QUIET)$(COPY) src/DiffExampleUIThread.previous.java src/DiffExampleUIThread.java $(QUIET)$(call silent_on_success,Testing Cost Differential: previous,\ - $(INFER_BIN) --debug --no-filtering --cost-only -o $(PREVIOUS_DIR) -- $(JAVAC) -cp $(CLASSPATH) src/*.java) + $(INFER_BIN) --debug --no-filtering --cost-only -o $(PREVIOUS_DIR) -- $(JAVAC) -cp $(CLASSPATH) $(COPIED)) diff --git a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.java.current b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.current.java similarity index 100% rename from infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.java.current rename to infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.current.java diff --git a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.java.previous b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.previous.java similarity index 100% rename from infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.java.previous rename to infer/tests/build_systems/differential_of_costs_report_java/src/DiffExample.previous.java diff --git a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.current b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.current.java similarity index 99% rename from infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.current rename to infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.current.java index f89e6756e..2461d037e 100644 --- a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.current +++ b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.current.java @@ -33,4 +33,4 @@ public class DiffExampleUIThread { f1(x); } -} \ No newline at end of file +} diff --git a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.previous b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.previous.java similarity index 99% rename from infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.previous rename to infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.previous.java index 05e642909..0f429287d 100644 --- a/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.java.previous +++ b/infer/tests/build_systems/differential_of_costs_report_java/src/DiffExampleUIThread.previous.java @@ -33,4 +33,4 @@ public class DiffExampleUIThread { return f2(x); } -} \ No newline at end of file +} diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/Makefile b/infer/tests/build_systems/differential_of_costs_report_objc/Makefile index 907e9b54a..a254afbd8 100644 --- a/infer/tests/build_systems/differential_of_costs_report_objc/Makefile +++ b/infer/tests/build_systems/differential_of_costs_report_objc/Makefile @@ -6,7 +6,9 @@ # E2E test for differential of costs TESTS_DIR = ../.. -SOURCES = src/DiffBlock.m.current src/DiffBlock.m.previous +SOURCES = src/DiffBlock.current.m src/DiffBlock.previous.m +COPIED = src/DiffBlock.m +CLEAN_EXTRA = $(COPIED) CLANG_OPTIONS = -c $(OBJC_CLANG_OPTIONS) include $(TESTS_DIR)/differential.make include $(TESTS_DIR)/objc.make @@ -16,11 +18,11 @@ INFERPRINT_ISSUES_FIELDS = \ $(CURRENT_REPORT) $(PREVIOUS_REPORT): $(OBJC_DEPS) $(CURRENT_REPORT): - $(QUIET)$(COPY) src/DiffBlock.m.current src/DiffBlock.m + $(QUIET)$(COPY) src/DiffBlock.current.m src/DiffBlock.m $(QUIET)$(call silent_on_success,Testing Cost Differential: current,\ - $(INFER_BIN) --no-filtering --cost-only -o $(CURRENT_DIR) -- clang $(CLANG_OPTIONS) src/*.m) + $(INFER_BIN) --no-filtering --cost-only -o $(CURRENT_DIR) -- clang $(CLANG_OPTIONS) $(COPIED)) $(PREVIOUS_REPORT): - $(QUIET)$(COPY) src/DiffBlock.m.previous src/DiffBlock.m + $(QUIET)$(COPY) src/DiffBlock.previous.m src/DiffBlock.m $(QUIET)$(call silent_on_success,Testing Cost Differential: previous,\ - $(INFER_BIN) --debug --no-filtering --cost-only -o $(PREVIOUS_DIR) -- clang $(CLANG_OPTIONS) src/*.m) + $(INFER_BIN) --debug --no-filtering --cost-only -o $(PREVIOUS_DIR) -- clang $(CLANG_OPTIONS) $(COPIED)) diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m.current b/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m similarity index 100% rename from infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m.current rename to infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.current.m diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m.previous b/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m.previous deleted file mode 100644 index c4ec0c836..000000000 --- a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m.previous +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -#import - -@interface CallBlocks : NSObject - -- (void)take_two_blocks:(NSInteger*)n - block1:(void (^)(NSInteger*))block1 - block2:(void (^)(NSInteger*))block2; - -@end - -@implementation CallBlocks - -- (id)init { - return self; -} - -- (void)take_two_blocks:(NSInteger*)n - block1:(void (^)(NSInteger*))block1 - block2:(void (^)(NSInteger*))block2 { - block1(n); - block2(n); -} - -@end - -@interface Handler : NSObject -@end - -@implementation Handler - -- (void (^)(NSString*))func_linear { - return ^(NSString* str) { - NSLog(@"Report error : %@ \n", str); - }; -} - -- (void)func_linear:(NSArray*)array { - for (id value in array) { - } -} - -@end - -int main() { return 0; } diff --git a/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m b/infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.previous.m similarity index 100% rename from infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.m rename to infer/tests/build_systems/differential_of_costs_report_objc/src/DiffBlock.previous.m