Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running tests on any arch #2355

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/recipes/test_icu.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import unittest
from unittest import mock
from platform import system

from tests.recipes.recipe_ctx import RecipeCtx
from pythonforandroid.recipes.icu import ICURecipe
from pythonforandroid.util import build_platform


class TestIcuRecipe(RecipeCtx, unittest.TestCase):
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_build_arch(
):
mock_find_executable.return_value = os.path.join(
self.ctx._ndk_dir,
f"toolchains/llvm/prebuilt/{system().lower()}-x86_64/bin/clang",
f"toolchains/llvm/prebuilt/{build_platform}/bin/clang",
)
mock_archs_glob.return_value = [
os.path.join(self.ctx._ndk_dir, "toolchains", "llvm")
Expand Down
5 changes: 2 additions & 3 deletions tests/test_archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import unittest
from os import environ
from unittest import mock
from platform import system

from pythonforandroid.bootstrap import Bootstrap
from pythonforandroid.distribution import Distribution
from pythonforandroid.recipe import Recipe
from pythonforandroid.build import Context
from pythonforandroid.util import BuildInterruptingException
from pythonforandroid.util import BuildInterruptingException, build_platform
from pythonforandroid.archs import (
Arch,
ArchARM,
Expand Down Expand Up @@ -72,7 +71,7 @@ def setUp(self):
# should be the same for all the tests (no more gcc compiler)
self.expected_compiler = (
f"/opt/android/android-ndk/toolchains/"
f"llvm/prebuilt/{system().lower()}-x86_64/bin/clang"
f"llvm/prebuilt/{build_platform}/bin/clang"
)


Expand Down
5 changes: 2 additions & 3 deletions tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import unittest

from unittest import mock
from platform import system

from pythonforandroid.bootstrap import (
_cmp_bootstraps_by_priority, Bootstrap, expand_dependencies,
Expand All @@ -13,7 +12,7 @@
from pythonforandroid.recipe import Recipe
from pythonforandroid.archs import ArchARMv7_a
from pythonforandroid.build import Context
from pythonforandroid.util import BuildInterruptingException
from pythonforandroid.util import BuildInterruptingException, build_platform

from test_graph import get_fake_recipe

Expand Down Expand Up @@ -531,7 +530,7 @@ def test_bootstrap_strip(
):
mock_find_executable.return_value = os.path.join(
self.ctx._ndk_dir,
f"toolchains/llvm/prebuilt/{system().lower()}-x86_64/bin/clang",
f"toolchains/llvm/prebuilt/{build_platform}/bin/clang",
)
mock_glob.return_value = [
os.path.join(self.ctx._ndk_dir, "toolchains", "llvm")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import warnings
from unittest import mock
from backports import tempfile
from platform import system

from pythonforandroid.build import Context
from pythonforandroid.recipe import Recipe, import_recipe
from pythonforandroid.archs import ArchAarch_64
from pythonforandroid.bootstrap import Bootstrap
from pythonforandroid.util import build_platform
from test_bootstrap import BaseClassSetupBootstrap


Expand Down Expand Up @@ -284,7 +284,7 @@ def test_get_recipe_env_with(
"""
expected_compiler = (
f"/opt/android/android-ndk/toolchains/"
f"llvm/prebuilt/{system().lower()}-x86_64/bin/clang"
f"llvm/prebuilt/{build_platform}/bin/clang"
)
mock_find_executable.return_value = expected_compiler
mock_glob.return_value = ["llvm"]
Expand Down