diff options
author | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 20:01:56 +0000 |
---|---|---|
committer | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 20:01:56 +0000 |
commit | 712398266266d2a10cf22c7bfc9e90a1e1fb4581 (patch) | |
tree | 54b71d4697aab7894fcae86b83995b8f7c3af1fa | |
parent | 5d5a21d42f4abb179f3692889dc4afc6e653edfb (diff) | |
download | chromium_src-712398266266d2a10cf22c7bfc9e90a1e1fb4581.zip chromium_src-712398266266d2a10cf22c7bfc9e90a1e1fb4581.tar.gz chromium_src-712398266266d2a10cf22c7bfc9e90a1e1fb4581.tar.bz2 |
[NaCl SDK] Run sel_ldr-based unit tests as natively-build linux tests as well.
This mode allows us to use native linux debugging and profiling
tools (valgrind, etc..).
R=binji@chromium.org
Review URL: https://codereview.chromium.org/300603002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273561 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 19 insertions, 9 deletions
diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list index 46dffbc..f7303d3 100644 --- a/native_client_sdk/src/build_tools/sdk_files.list +++ b/native_client_sdk/src/build_tools/sdk_files.list @@ -99,6 +99,7 @@ include/win/sys/poll.h [linux]lib/${PLATFORM}_host/Debug/libppapi_cpp_private.a [linux]lib/${PLATFORM}_host/Debug/libppapi_gles2.a [linux]lib/${PLATFORM}_host/Debug/libppapi_simple.a +[linux]lib/${PLATFORM}_host/Debug/libsdk_util.a [linux]lib/${PLATFORM}_host/Release/libgmock.a [linux]lib/${PLATFORM}_host/Release/libgtest.a [linux]lib/${PLATFORM}_host/Release/libjsoncpp.a @@ -108,6 +109,7 @@ include/win/sys/poll.h [linux]lib/${PLATFORM}_host/Release/libppapi_cpp_private.a [linux]lib/${PLATFORM}_host/Release/libppapi_gles2.a [linux]lib/${PLATFORM}_host/Release/libppapi_simple.a +[linux]lib/${PLATFORM}_host/Release/libsdk_util.a [win]lib/${PLATFORM}_x86_32_host/Debug/gmock.lib [win]lib/${PLATFORM}_x86_32_host/Debug/gtest.lib [win]lib/${PLATFORM}_x86_32_host/Debug/jsoncpp.lib diff --git a/native_client_sdk/src/build_tools/test_sdk.py b/native_client_sdk/src/build_tools/test_sdk.py index 61e6373..cefb908 100755 --- a/native_client_sdk/src/build_tools/test_sdk.py +++ b/native_client_sdk/src/build_tools/test_sdk.py @@ -70,9 +70,10 @@ def StepRunSelLdrTests(pepperdir): tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters) - def RunTest(test, toolchain, arch, config): - args = ['TOOLCHAIN=%s' % toolchain, 'NACL_ARCH=%s' % arch] - args += ['SEL_LDR=1', 'run'] + def RunTest(test, toolchain, config, arch=None): + args = ['run', 'STANDALONE=1', 'TOOLCHAIN=%s' % toolchain] + if arch is not None: + args.append('NACL_ARCH=%s' % arch) build_projects.BuildProjectsBranch(pepperdir, test, clean=False, deps=False, config=config, args=args) @@ -93,10 +94,17 @@ def StepRunSelLdrTests(pepperdir): title = 'sel_ldr tests: %s' % os.path.basename(project['NAME']) location = os.path.join(root, project['NAME']) buildbot_common.BuildStep(title) + + # On linux we can run the standalone tests natively using the host + # compiler. + if getos.GetPlatform() == 'linux': + for config in ('Debug', 'Release'): + RunTest(location, 'linux', config) + for toolchain in ('newlib', 'glibc'): for arch in archs: for config in ('Debug', 'Release'): - RunTest(location, toolchain, arch, config) + RunTest(location, toolchain, config, arch) def StepRunBrowserTests(toolchains, experimental): diff --git a/native_client_sdk/src/examples/tutorial/testing/example.dsc b/native_client_sdk/src/examples/tutorial/testing/example.dsc index 8af9caa..8284c15 100644 --- a/native_client_sdk/src/examples/tutorial/testing/example.dsc +++ b/native_client_sdk/src/examples/tutorial/testing/example.dsc @@ -1,5 +1,5 @@ { - 'TOOLS': ['glibc', 'newlib', 'pnacl'], + 'TOOLS': ['glibc', 'newlib', 'pnacl', 'linux'], 'SEL_LDR': True, 'TARGETS': [ { diff --git a/native_client_sdk/src/examples/tutorial/testing/testing.cc b/native_client_sdk/src/examples/tutorial/testing/testing.cc index c9ee0db..57ae127 100644 --- a/native_client_sdk/src/examples/tutorial/testing/testing.cc +++ b/native_client_sdk/src/examples/tutorial/testing/testing.cc @@ -9,7 +9,7 @@ TEST(TestCase, SimpleTest) { } TEST(TestCase, AnotherTest) { - EXPECT_EQ(4, sizeof(void*)); + EXPECT_EQ(1, sizeof(char)); } #if defined(SEL_LDR) diff --git a/native_client_sdk/src/examples/tutorial/using_ppapi_simple/example.dsc b/native_client_sdk/src/examples/tutorial/using_ppapi_simple/example.dsc index 17b1c94..be68bc3 100644 --- a/native_client_sdk/src/examples/tutorial/using_ppapi_simple/example.dsc +++ b/native_client_sdk/src/examples/tutorial/using_ppapi_simple/example.dsc @@ -1,5 +1,5 @@ { - 'TOOLS': ['newlib', 'glibc', 'pnacl'], + 'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux'], 'SEL_LDR': True, 'TARGETS': [ { diff --git a/native_client_sdk/src/libraries/sdk_util/library.dsc b/native_client_sdk/src/libraries/sdk_util/library.dsc index 4066d5b..961a43f 100644 --- a/native_client_sdk/src/libraries/sdk_util/library.dsc +++ b/native_client_sdk/src/libraries/sdk_util/library.dsc @@ -1,5 +1,5 @@ { - 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'win'], + 'TOOLS': ['bionic', 'newlib', 'glibc', 'pnacl', 'win', 'linux'], 'TARGETS': [ { 'NAME' : 'sdk_util', diff --git a/native_client_sdk/src/tests/sdk_util_test/example.dsc b/native_client_sdk/src/tests/sdk_util_test/example.dsc index 1481069..17d2cf7 100644 --- a/native_client_sdk/src/tests/sdk_util_test/example.dsc +++ b/native_client_sdk/src/tests/sdk_util_test/example.dsc @@ -1,5 +1,5 @@ { - 'TOOLS': ['newlib', 'glibc', 'pnacl'], + 'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux'], 'SEL_LDR': True, 'TARGETS': [ |