From e2ff6e58a5f05a0a26eac9c153c0199b417f82de Mon Sep 17 00:00:00 2001 From: Ryan Rhee Date: Wed, 10 Aug 2016 08:24:52 -0700 Subject: [PATCH] `buck test componentkit` boilerplate Reviewed By: jvillard Differential Revision: D3693997 fbshipit-source-id: de64bbe --- .buckconfig | 1 + .../codetoanalyze/objcpp/componentkit/Test.mm | 15 ++++++++ infer/tests/endtoend/BUCK | 9 +++++ infer/tests/endtoend/objcpp/componentkit/BUCK | 35 +++++++++++++++++++ .../MutableLocalVariableTest.java | 18 ++++++++++ 5 files changed, 78 insertions(+) create mode 100644 infer/tests/codetoanalyze/objcpp/componentkit/Test.mm create mode 100644 infer/tests/endtoend/objcpp/componentkit/BUCK create mode 100644 infer/tests/endtoend/objcpp/componentkit/MutableLocalVariableTest.java diff --git a/.buckconfig b/.buckconfig index 42665d85e..a2a11542d 100644 --- a/.buckconfig +++ b/.buckconfig @@ -22,6 +22,7 @@ tracing = //infer/tests/endtoend/java/tracing:tracing linters = //infer/tests/endtoend:linters + componentkit = //infer/tests/endtoend:componentkit [project] ignore = .git, .ml, .mli diff --git a/infer/tests/codetoanalyze/objcpp/componentkit/Test.mm b/infer/tests/codetoanalyze/objcpp/componentkit/Test.mm new file mode 100644 index 000000000..318e1d0da --- /dev/null +++ b/infer/tests/codetoanalyze/objcpp/componentkit/Test.mm @@ -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. + */ + +#import + +@interface SomeClass : NSObject +@end +@implementation SomeClass +@end diff --git a/infer/tests/endtoend/BUCK b/infer/tests/endtoend/BUCK index d0f15c5cf..980f4e0af 100644 --- a/infer/tests/endtoend/BUCK +++ b/infer/tests/endtoend/BUCK @@ -86,3 +86,12 @@ java_test( '//infer/tests/endtoend/objcpp/linters:linters', ], ) + +# ############### ComponentKit tests ######################## + +java_test( + name='componentkit', + deps=[ + '//infer/tests/endtoend/objcpp/componentkit:componentkit', + ], +) diff --git a/infer/tests/endtoend/objcpp/componentkit/BUCK b/infer/tests/endtoend/objcpp/componentkit/BUCK new file mode 100644 index 000000000..460a77bbd --- /dev/null +++ b/infer/tests/endtoend/objcpp/componentkit/BUCK @@ -0,0 +1,35 @@ +tests_dependencies = [ + '//infer/lib/java/android:android', + '//dependencies/java/guava:guava', + '//dependencies/java/junit:hamcrest', + '//dependencies/java/jackson:jackson', + '//dependencies/java/jsr-305:jsr-305', + '//dependencies/java/junit:junit', + '//dependencies/java/opencsv:opencsv', + '//infer/tests/utils:utils', +] + +objcpp_linters_test_sources = glob(['*.java']) +objcpp_linters_test_deps = [] +for test_source in objcpp_linters_test_sources: + target_name = test_source.replace("/", "_")[:-len(".java")] + objcpp_linters_test_deps.append(target_name) + + java_test( + name=target_name, + srcs=[test_source], + deps=tests_dependencies, + visibility=[ + 'PUBLIC', + ], + source='7', + target='7', + ) + +java_test( + name='componentkit', + deps=[':' + x for x in objcpp_linters_test_deps], + visibility=[ + 'PUBLIC', + ], +) diff --git a/infer/tests/endtoend/objcpp/componentkit/MutableLocalVariableTest.java b/infer/tests/endtoend/objcpp/componentkit/MutableLocalVariableTest.java new file mode 100644 index 000000000..b62d25463 --- /dev/null +++ b/infer/tests/endtoend/objcpp/componentkit/MutableLocalVariableTest.java @@ -0,0 +1,18 @@ +/* + * 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. + */ + +package endtoend.objcpp.componentkit; + import org.junit.Test; + + public class MutableLocalVariableTest { + @Test + public void MLVsInComponentFile() { + // do nothing fro now + } +}