Sha256: a62550a921458ad30f92656e423a72e76e7667b0dad4052dbd1cf92da0242e60

Contents?: true

Size: 1.2 KB

Versions: 1581

Compression:

Stored size: 1.2 KB

Contents

import subprocess
import pathlib
import pytest

TEST_PATH = pathlib.Path(__file__).parents[1].resolve()

xfails = {}


def libffi_tests(self, selenium, libffi_test):
    if libffi_test in xfails:
        pytest.xfail(f'known failure with code "{xfails[libffi_test]}"')
    res = selenium.run_js(
        """
        window.TestModule = await Module();
        """
    )
    selenium.run_js(
        f"""
        try {{
            TestModule._test__{libffi_test}();
        }} catch(e){{
            if(e.name !== "ExitStatus"){{
                throw e;
            }}
            if(e.status !== 0){{
                throw new Error(`Terminated with nonzero status code ${{e.status}}: ` + e.message);
            }}
        }}
        """
    )


class TestCall:
    TEST_BUILD_DIR = "libffi.call.test"
    test_call = libffi_tests


class TestClosures:
    TEST_BUILD_DIR = "libffi.closures.test"
    test_closures = libffi_tests


def pytest_generate_tests(metafunc):
    test_build_dir = metafunc.cls.TEST_BUILD_DIR
    test_names = [x.stem for x in (TEST_PATH / test_build_dir).glob("*.o")]
    metafunc.parametrize("libffi_test", test_names)


if __name__ == "__main__":
    subprocess.call(["build-tests.sh", "libffi.call"])

Version data entries

1,581 entries across 1,580 versions & 16 rubygems

Version Path
ory-client-1.16.3 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.17 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.1/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ffi-1.17.1 ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.16 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.15 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.14 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.13 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
affixapi-1.1.102 vendor/bundle/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.12 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
ory-client-1.15.10 vendor/bundle/ruby/3.1.0/gems/ffi-1.17.0/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py