Skip to content

Commit

Permalink
Add test.py tests to the tests package.
Browse files Browse the repository at this point in the history
This lets us import from the NDK's python library, so we can abstract
some of this away rather than duplicating it in every similar test.

This also allows our pylintrc to apply to each test.

Test: ./validate.py --filter standalone_toolchain*
Bug: android/ndk#310
Change-Id: Ib112cca91b56009c838bc1712c8a9285a40976c1
  • Loading branch information
DanAlbert committed Mar 7, 2017
1 parent ee76735 commit 4b25333
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 12 deletions.
Empty file.
Empty file added tests/build/__init__.py
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
import logging
import os
import shutil
import site
import subprocess
import tempfile

site.addsitedir(os.path.join(os.environ['NDK'], 'build/lib'))

import build_support # pylint: disable=import-error
import build.lib.build_support


def logger():
Expand Down Expand Up @@ -56,7 +53,7 @@ def make_standalone_toolchain(arch, platform, install_dir):

def test_standalone_toolchain(arch, toolchain, install_dir):
if toolchain == '4.9':
triple = build_support.arch_to_triple(arch)
triple = build.lib.build_support.arch_to_triple(arch)
# x86 toolchain names are dumb: http://b/25800583
if arch == 'x86':
triple = 'i686-linux-android'
Expand All @@ -77,7 +74,7 @@ def run_test(abi=None, platform=None, toolchain=None,
build_flags=None): # pylint: disable=unused-argument
arch = 'arm'
if abi is not None:
arch = build_support.abi_to_arch(abi)
arch = build.lib.build_support.abi_to_arch(abi)

install_dir = tempfile.mkdtemp()
try:
Expand Down
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
import logging
import os
import shutil
import site
import subprocess
import tempfile

site.addsitedir(os.path.join(os.environ['NDK'], 'build/lib'))

import build_support # pylint: disable=import-error
import build.lib.build_support


def logger():
Expand Down Expand Up @@ -57,7 +54,7 @@ def make_standalone_toolchain(arch, platform, install_dir):

def test_standalone_toolchain(arch, toolchain, install_dir):
if toolchain == '4.9':
triple = build_support.arch_to_triple(arch)
triple = build.lib.build_support.arch_to_triple(arch)
# x86 toolchain names are dumb: http://b/25800583
if arch == 'x86':
triple = 'i686-linux-android'
Expand All @@ -78,7 +75,7 @@ def run_test(abi=None, platform=None, toolchain=None,
build_flags=None): # pylint: disable=unused-argument
arch = 'arm'
if abi is not None:
arch = build_support.abi_to_arch(abi)
arch = build.lib.build_support.abi_to_arch(abi)

install_dir = tempfile.mkdtemp()
try:
Expand Down

0 comments on commit 4b25333

Please sign in to comment.