コード例 #1
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_get_build_environment():
    class Options:
        qmake_parameters = list()
        qmake_project_file = ""

    plugin = QMakePlugin(part_name="my-part", options=Options())

    assert plugin.get_build_environment() == {"QT_SELECT": "qt5"}
コード例 #2
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_get_build_snaps():
    class Options:
        qmake_parameters = list()
        qmake_project_file = ""

    plugin = QMakePlugin(part_name="my-part", options=Options())

    assert plugin.get_build_snaps() == set()
コード例 #3
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_get_build_packages():
    class Options:
        qmake_parameters = list()
        qmake_project_file = ""

    plugin = QMakePlugin(part_name="my-part", options=Options())

    assert plugin.get_build_packages() == {"g++", "make", "qt5-qmake"}
コード例 #4
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_get_build_commands_with_qmake_parameters():
    class Options:
        qmake_parameters = ["-Wall"]
        qmake_project_file = ""

    plugin = QMakePlugin(part_name="my-part", options=Options())

    assert plugin.get_build_commands() == [
        'qmake QMAKE_CFLAGS+="${CFLAGS:-}" QMAKE_CXXFLAGS+="${CXXFLAGS:-}" QMAKE_LFLAGS+="${LDFLAGS:-}" -Wall "${SNAPCRAFT_PART_SRC_WORK}"',
        'env -u CFLAGS -u CXXFLAGS make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"',
        'make install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"',
    ]
コード例 #5
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_out_of_source_build():
    class Options:
        qmake_parameters = list()
        qmake_project_file = ""

    plugin = QMakePlugin(part_name="my-part", options=Options())

    assert plugin.out_of_source_build is True
コード例 #6
0
ファイル: test_qmake.py プロジェクト: ycheng/snapcraft
def test_schema():
    assert QMakePlugin.get_schema() == {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "additionalProperties": False,
        "properties": {
            "qmake-parameters": {
                "type": "array",
                "uniqueItems": True,
                "items": {
                    "type": "string"
                },
                "default": [],
            },
            "qmake-project-file": {
                "type": "string",
                "default": ""
            },
        },
    }