[pypy-commit] pypy arm-backend-2: move check if we are running tests on ARM to the conftest file
bivab
noreply at buildbot.pypy.org
Sat Jul 7 09:50:17 CEST 2012
Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r55952:f5969de8b32f
Date: 2012-07-07 09:17 +0200
http://bitbucket.org/pypy/pypy/changeset/f5969de8b32f/
Log: move check if we are running tests on ARM to the conftest file
diff --git a/pypy/jit/backend/arm/test/conftest.py b/pypy/jit/backend/arm/test/conftest.py
--- a/pypy/jit/backend/arm/test/conftest.py
+++ b/pypy/jit/backend/arm/test/conftest.py
@@ -1,7 +1,12 @@
"""
This conftest adds an option to run the translation tests which by default will
be disabled.
+Also it disables the backend tests on non ARMv7 platforms
"""
+import py, os
+from pypy.jit.backend import detect_cpu
+
+cpu = detect_cpu.autodetect()
def pytest_addoption(parser):
group = parser.getgroup('translation test options')
@@ -10,3 +15,7 @@
default=False,
dest="run_translation_tests",
help="run tests that translate code")
+
+def pytest_runtest_setup(item):
+ if cpu != 'arm':
+ py.test.skip("ARM(v7) tests skipped: cpu is %r" % (cpu,))
diff --git a/pypy/jit/backend/arm/test/support.py b/pypy/jit/backend/arm/test/support.py
--- a/pypy/jit/backend/arm/test/support.py
+++ b/pypy/jit/backend/arm/test/support.py
@@ -27,12 +27,9 @@
asm.mc._dump_trace(addr, 'test.asm')
return func()
-def skip_unless_arm():
- check_skip(os.uname()[4])
-
def skip_unless_run_translation():
if not pytest.config.option.run_translation_tests:
- py.test.skip("Test skipped beause --run-translation-tests option is not set")
+ py.test.skip("Test skipped because --run-translation-tests option is not set")
def requires_arm_as():
diff --git a/pypy/jit/backend/arm/test/test_arch.py b/pypy/jit/backend/arm/test/test_arch.py
--- a/pypy/jit/backend/arm/test/test_arch.py
+++ b/pypy/jit/backend/arm/test/test_arch.py
@@ -1,6 +1,4 @@
from pypy.jit.backend.arm import arch
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
def test_mod():
assert arch.arm_int_mod(10, 2) == 0
diff --git a/pypy/jit/backend/arm/test/test_assembler.py b/pypy/jit/backend/arm/test/test_assembler.py
--- a/pypy/jit/backend/arm/test/test_assembler.py
+++ b/pypy/jit/backend/arm/test/test_assembler.py
@@ -3,7 +3,7 @@
from pypy.jit.backend.arm.arch import arm_int_div
from pypy.jit.backend.arm.assembler import AssemblerARM
from pypy.jit.backend.arm.locations import imm
-from pypy.jit.backend.arm.test.support import skip_unless_arm, run_asm
+from pypy.jit.backend.arm.test.support import run_asm
from pypy.jit.backend.detect_cpu import getcpuclass
from pypy.jit.metainterp.resoperation import rop
@@ -12,8 +12,6 @@
from pypy.jit.metainterp.history import JitCellToken
from pypy.jit.backend.model import CompiledLoopToken
-skip_unless_arm()
-
CPU = getcpuclass()
diff --git a/pypy/jit/backend/arm/test/test_calling_convention.py b/pypy/jit/backend/arm/test/test_calling_convention.py
--- a/pypy/jit/backend/arm/test/test_calling_convention.py
+++ b/pypy/jit/backend/arm/test/test_calling_convention.py
@@ -3,8 +3,6 @@
from pypy.jit.backend.test.calling_convention_test import TestCallingConv, parse
from pypy.rpython.lltypesystem import lltype
from pypy.jit.codewriter.effectinfo import EffectInfo
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestARMCallingConvention(TestCallingConv):
diff --git a/pypy/jit/backend/arm/test/test_gc_integration.py b/pypy/jit/backend/arm/test/test_gc_integration.py
--- a/pypy/jit/backend/arm/test/test_gc_integration.py
+++ b/pypy/jit/backend/arm/test/test_gc_integration.py
@@ -20,9 +20,7 @@
from pypy.jit.backend.arm.test.test_regalloc import BaseTestRegalloc
from pypy.jit.backend.arm.regalloc import ARMFrameManager, VFPRegisterManager
from pypy.jit.codewriter.effectinfo import EffectInfo
-from pypy.jit.backend.arm.test.support import skip_unless_arm
from pypy.jit.backend.arm.regalloc import Regalloc, ARMv7RegisterManager
-skip_unless_arm()
CPU = getcpuclass()
diff --git a/pypy/jit/backend/arm/test/test_generated.py b/pypy/jit/backend/arm/test/test_generated.py
--- a/pypy/jit/backend/arm/test/test_generated.py
+++ b/pypy/jit/backend/arm/test/test_generated.py
@@ -10,8 +10,6 @@
from pypy.jit.metainterp.resoperation import ResOperation, rop
from pypy.rpython.test.test_llinterp import interpret
from pypy.jit.backend.detect_cpu import getcpuclass
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
CPU = getcpuclass()
class TestStuff(object):
diff --git a/pypy/jit/backend/arm/test/test_helper.py b/pypy/jit/backend/arm/test/test_helper.py
--- a/pypy/jit/backend/arm/test/test_helper.py
+++ b/pypy/jit/backend/arm/test/test_helper.py
@@ -1,8 +1,6 @@
from pypy.jit.backend.arm.helper.assembler import count_reg_args
from pypy.jit.metainterp.history import (BoxInt, BoxPtr, BoxFloat,
INT, REF, FLOAT)
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
def test_count_reg_args():
diff --git a/pypy/jit/backend/arm/test/test_instr_codebuilder.py b/pypy/jit/backend/arm/test/test_instr_codebuilder.py
--- a/pypy/jit/backend/arm/test/test_instr_codebuilder.py
+++ b/pypy/jit/backend/arm/test/test_instr_codebuilder.py
@@ -5,8 +5,6 @@
from pypy.jit.backend.arm.test.support import (requires_arm_as, define_test, gen_test_function)
from gen import assemble
import py
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
requires_arm_as()
diff --git a/pypy/jit/backend/arm/test/test_jump.py b/pypy/jit/backend/arm/test/test_jump.py
--- a/pypy/jit/backend/arm/test/test_jump.py
+++ b/pypy/jit/backend/arm/test/test_jump.py
@@ -6,8 +6,6 @@
from pypy.jit.backend.arm.regalloc import ARMFrameManager
from pypy.jit.backend.arm.jump import remap_frame_layout, remap_frame_layout_mixed
from pypy.jit.metainterp.history import INT
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
frame_pos = ARMFrameManager.frame_pos
diff --git a/pypy/jit/backend/arm/test/test_list.py b/pypy/jit/backend/arm/test/test_list.py
--- a/pypy/jit/backend/arm/test/test_list.py
+++ b/pypy/jit/backend/arm/test/test_list.py
@@ -1,8 +1,6 @@
from pypy.jit.metainterp.test.test_list import ListTests
from pypy.jit.backend.arm.test.support import JitARMMixin
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestList(JitARMMixin, ListTests):
# for individual tests see
diff --git a/pypy/jit/backend/arm/test/test_loop_unroll.py b/pypy/jit/backend/arm/test/test_loop_unroll.py
--- a/pypy/jit/backend/arm/test/test_loop_unroll.py
+++ b/pypy/jit/backend/arm/test/test_loop_unroll.py
@@ -1,8 +1,6 @@
import py
from pypy.jit.backend.x86.test.test_basic import Jit386Mixin
from pypy.jit.metainterp.test import test_loop_unroll
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestLoopSpec(Jit386Mixin, test_loop_unroll.LoopUnrollTest):
# for the individual tests see
diff --git a/pypy/jit/backend/arm/test/test_recompilation.py b/pypy/jit/backend/arm/test/test_recompilation.py
--- a/pypy/jit/backend/arm/test/test_recompilation.py
+++ b/pypy/jit/backend/arm/test/test_recompilation.py
@@ -1,6 +1,4 @@
from pypy.jit.backend.arm.test.test_regalloc import BaseTestRegalloc
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestRecompilation(BaseTestRegalloc):
diff --git a/pypy/jit/backend/arm/test/test_recursive.py b/pypy/jit/backend/arm/test/test_recursive.py
--- a/pypy/jit/backend/arm/test/test_recursive.py
+++ b/pypy/jit/backend/arm/test/test_recursive.py
@@ -1,8 +1,6 @@
from pypy.jit.metainterp.test.test_recursive import RecursiveTests
from pypy.jit.backend.arm.test.support import JitARMMixin
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestRecursive(JitARMMixin, RecursiveTests):
# for the individual tests see
diff --git a/pypy/jit/backend/arm/test/test_regalloc.py b/pypy/jit/backend/arm/test/test_regalloc.py
--- a/pypy/jit/backend/arm/test/test_regalloc.py
+++ b/pypy/jit/backend/arm/test/test_regalloc.py
@@ -16,9 +16,7 @@
from pypy.rpython.annlowlevel import llhelper
from pypy.rpython.lltypesystem import rclass, rstr
from pypy.jit.codewriter.effectinfo import EffectInfo
-from pypy.jit.backend.arm.test.support import skip_unless_arm
from pypy.jit.codewriter import longlong
-skip_unless_arm()
def test_is_comparison_or_ovf_op():
diff --git a/pypy/jit/backend/arm/test/test_regalloc2.py b/pypy/jit/backend/arm/test/test_regalloc2.py
--- a/pypy/jit/backend/arm/test/test_regalloc2.py
+++ b/pypy/jit/backend/arm/test/test_regalloc2.py
@@ -5,8 +5,6 @@
from pypy.jit.metainterp.resoperation import rop
from pypy.jit.backend.detect_cpu import getcpuclass
from pypy.jit.backend.arm.arch import WORD
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
CPU = getcpuclass()
def test_bug_rshift():
diff --git a/pypy/jit/backend/arm/test/test_regalloc_mov.py b/pypy/jit/backend/arm/test/test_regalloc_mov.py
--- a/pypy/jit/backend/arm/test/test_regalloc_mov.py
+++ b/pypy/jit/backend/arm/test/test_regalloc_mov.py
@@ -8,8 +8,6 @@
from pypy.jit.backend.arm.arch import WORD
from pypy.jit.metainterp.history import FLOAT
import py
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class MockInstr(object):
diff --git a/pypy/jit/backend/arm/test/test_runner.py b/pypy/jit/backend/arm/test/test_runner.py
--- a/pypy/jit/backend/arm/test/test_runner.py
+++ b/pypy/jit/backend/arm/test/test_runner.py
@@ -4,7 +4,6 @@
from pypy.jit.backend.test.runner_test import LLtypeBackendTest, \
boxfloat, \
constfloat
-from pypy.jit.backend.arm.test.support import skip_unless_arm
from pypy.jit.metainterp.history import (BasicFailDescr,
BoxInt,
ConstInt)
@@ -15,8 +14,6 @@
from pypy.jit.codewriter.effectinfo import EffectInfo
from pypy.jit.metainterp.history import JitCellToken, TargetToken
-skip_unless_arm()
-
class FakeStats(object):
pass
diff --git a/pypy/jit/backend/arm/test/test_string.py b/pypy/jit/backend/arm/test/test_string.py
--- a/pypy/jit/backend/arm/test/test_string.py
+++ b/pypy/jit/backend/arm/test/test_string.py
@@ -1,8 +1,6 @@
import py
from pypy.jit.metainterp.test import test_string
from pypy.jit.backend.arm.test.support import JitARMMixin
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
class TestString(JitARMMixin, test_string.TestLLtype):
# for the individual tests see
diff --git a/pypy/jit/backend/arm/test/test_trace_operations.py b/pypy/jit/backend/arm/test/test_trace_operations.py
--- a/pypy/jit/backend/arm/test/test_trace_operations.py
+++ b/pypy/jit/backend/arm/test/test_trace_operations.py
@@ -1,6 +1,3 @@
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
-
from pypy.jit.backend.x86.test.test_regalloc import BaseTestRegalloc
from pypy.jit.backend.detect_cpu import getcpuclass
from pypy.rpython.lltypesystem import lltype, llmemory
diff --git a/pypy/jit/backend/arm/test/test_zll_random.py b/pypy/jit/backend/arm/test/test_zll_random.py
--- a/pypy/jit/backend/arm/test/test_zll_random.py
+++ b/pypy/jit/backend/arm/test/test_zll_random.py
@@ -4,8 +4,6 @@
from pypy.jit.backend.test.test_ll_random import LLtypeOperationBuilder
from pypy.jit.backend.test.test_random import check_random_function, Random
from pypy.jit.metainterp.resoperation import rop
-from pypy.jit.backend.arm.test.support import skip_unless_arm
-skip_unless_arm()
CPU = getcpuclass()
diff --git a/pypy/jit/backend/arm/test/test_zrpy_gc.py b/pypy/jit/backend/arm/test/test_zrpy_gc.py
--- a/pypy/jit/backend/arm/test/test_zrpy_gc.py
+++ b/pypy/jit/backend/arm/test/test_zrpy_gc.py
@@ -14,9 +14,7 @@
from pypy.jit.backend.llsupport.gc import GcLLDescr_framework
from pypy.tool.udir import udir
from pypy.config.translationoption import DEFL_GC
-from pypy.jit.backend.arm.test.support import skip_unless_arm
from pypy.jit.backend.arm.test.support import skip_unless_run_translation
-skip_unless_arm()
skip_unless_run_translation()
diff --git a/pypy/jit/backend/arm/test/test_ztranslation.py b/pypy/jit/backend/arm/test/test_ztranslation.py
--- a/pypy/jit/backend/arm/test/test_ztranslation.py
+++ b/pypy/jit/backend/arm/test/test_ztranslation.py
@@ -9,9 +9,7 @@
from pypy.jit.codewriter.policy import StopAtXPolicy
from pypy.translator.translator import TranslationContext
from pypy.config.translationoption import DEFL_GC
-from pypy.jit.backend.arm.test.support import skip_unless_arm
from pypy.jit.backend.arm.test.support import skip_unless_run_translation
-skip_unless_arm()
skip_unless_run_translation()
class TestTranslationARM(CCompiledMixin):
More information about the pypy-commit
mailing list