ndk-build integration test

Reviewed By: jvillard

Differential Revision: D3405859

fbshipit-source-id: 24a068f
master
Daiva Naudziuniene 9 years ago committed by Facebook Github Bot 5
parent 229ca26c8b
commit d707c717f0

@ -71,6 +71,7 @@ ALL_TESTS = [
'unknown_ext', 'unknown_ext',
'utf8_in_pwd', 'utf8_in_pwd',
'waf', 'waf',
'ndk-build',
] ]
to_test = ALL_TESTS to_test = ALL_TESTS
@ -334,6 +335,19 @@ class BuildIntegrationTest(unittest.TestCase):
enabled=enabled, enabled=enabled,
report_fname=report_fname) report_fname=report_fname)
def test_ndkbuild_integration(self):
root = os.path.join(CODETOANALYZE_DIR, 'ndk-build', 'hello_app')
gen_lib_dir = os.path.join(root, 'libs')
gen_obj_dir = os.path.join(root, 'obj')
if test('ndk-build', 'ndk-build',
root,
[['ndk-build', '-B', 'NDK_LIBS_OUT=./libs', 'NDK_OUT=./obj']],
clean_commands=[['ndk-build', 'clean']],
available=lambda: is_tool_available(['ndk-build', '-v'])):
# remove libs/ and obj/ directories
shutil.rmtree(gen_lib_dir)
shutil.rmtree(gen_obj_dir)
def test_wonky_locale_integration(self): def test_wonky_locale_integration(self):
env = os.environ.copy() env = os.environ.copy()
env['LC_ALL'] = 'C' env['LC_ALL'] = 'C'

@ -0,0 +1,15 @@
/*
* 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.
*/
#include <stdlib.h>
void test() {
int* s = NULL;
*s = 42;
}

@ -0,0 +1,5 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello
LOCAL_SRC_FILES := ../hello.c
include $(BUILD_SHARED_LIBRARY)

@ -0,0 +1,7 @@
[
{
"bug_type": "NULL_DEREFERENCE",
"file": "hello.c",
"procedure": "test"
}
]
Loading…
Cancel
Save