diff --git a/Makefile b/Makefile index d69d4652d..de2ad7ce3 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,7 @@ buck_test: infer buck_test_xml: infer make direct_tests - echo '' > test.xml # TODO: generate test.xml with test results + buck test --xml test.xml # TODO: generate test.xml with test results NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py inferTraceBugs_test: infer diff --git a/configure.ac b/configure.ac index aa0b929d8..49cd891e8 100644 --- a/configure.ac +++ b/configure.ac @@ -254,8 +254,8 @@ AC_SUBST([ENABLE_OCAML_BINANNOT]) # We use Buck to run the Infer tests AC_MSG_CHECKING([which version of Buck to use]) buckversion_file=.buckversion -oss_buck_version=a965937ccdadf8119a98ab766c3feb0708dc424e -fb_buck_version=440619c312cf07951891083d8f02d05a713205b5 +oss_buck_version=7722fca11136f5059c113379969a116802a58df0 +fb_buck_version=3a688647b6fca77bda05ab55f2f53860a470edfc AS_IF([test x"$is_facebook_tree" = x"yes"], [buck_version=$fb_buck_version], [buck_version=$oss_buck_version]) diff --git a/infer/tests/build_systems/build_integration_tests.py b/infer/tests/build_systems/build_integration_tests.py index 881aba5c8..c8f60c8c7 100755 --- a/infer/tests/build_systems/build_integration_tests.py +++ b/infer/tests/build_systems/build_integration_tests.py @@ -344,12 +344,11 @@ class BuildIntegrationTest(unittest.TestCase): env=env) def test_buck_integration(self): - target = '//infer/tests/codetoanalyze/java/infer:analyze' + target = '//infer/tests/codetoanalyze/java/infer:compile' test('buck', 'Buck', ROOT_DIR, [{'compile': ['buck', 'build', target]}], clean_commands=[['buck', 'clean']], - enabled=(sys.platform == 'darwin'), available=lambda: is_tool_available(['buck', '--version'])) def test_make_integration( diff --git a/infer/tests/codetoanalyze/java/infer/BUCK b/infer/tests/codetoanalyze/java/infer/BUCK index 615ad8051..effb93ac0 100644 --- a/infer/tests/codetoanalyze/java/infer/BUCK +++ b/infer/tests/codetoanalyze/java/infer/BUCK @@ -1,48 +1,17 @@ # TODO: this file exists only to support buck integration in infer/tests/build_systems/build_integration_tests.py -sources = glob(['**/*.java']) - -dependencies = [ - '//infer/lib/java/android:android', - '//dependencies/java/jackson:jackson', - '//infer/lib/java:models', - '//infer/annotations:annotations', -] java_library( - name = 'infer', - srcs = sources, - deps = dependencies, - visibility = [ + name = 'compile', + srcs = glob(['**/*.java']), + deps = [ + '//dependencies/java/guava:guava', + '//dependencies/java/jsr-305:jsr-305', + '//dependencies/java/jackson:jackson', + '//infer/annotations:annotations', + '//infer/lib/java/android:android', + '//infer/models/java:builtins', + ], + visibility = [ 'PUBLIC' ] ) - -def analysis_cmd(analyzer): - out = 'out' - clean_cmd = ' '.join(['rm', '-rf', out]) - classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) - infer_cmd = ' '.join([ - 'infer', - '--no-progress-bar', - '--absolute-paths', - '--no-filtering', - '-o', out, - '-a', analyzer, - '--', - 'javac', - '-cp', classpath, - '$SRCS', - ]) - copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT']) - return ' && '.join([clean_cmd, infer_cmd, copy_cmd]) - -genrule( - name = 'analyze', - out = 'report.csv', - cmd = analysis_cmd('infer'), - deps = dependencies + [':infer'], - srcs = sources, - visibility = [ - 'PUBLIC', - ], -)