Пример #1
0
    def test_script_buildoptions(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '04-buildoptions'))
        info = script.extract_from(group='buildoptions')

        assert (info[0]['name'] == 'auto_features')
        assert (info[0]['value'] == 'auto')
Пример #2
0
    def test_script_targets(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '07-targets'))
        info = script.extract_from(group='targets')

        assert (info[0]['name'] == 'prog')
        assert (info[0]['type'] == 'executable')
        assert (info[0]['id'] == 'prog@exe')
Пример #3
0
    def test_script_projectinfo(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '01-projectinfo'))
        info = script.extract_from(group='projectinfo')

        assert (info['descriptive_name'] == 'simple-case')
        assert (info['version'] == '0.1')
        assert (info['subproject_dir'] == 'subprojects')
Пример #4
0
 def test_script_bad_extract_method(self):
     reader: MesonScriptReader = MesonScriptReader(None)
     with pytest.raises(Exception) as e:
         reader = reader.extract_from(group='not-a-key')
     assert ('Group tag not-a-key not found in extract via data options!' ==
             str(e.value))
Пример #5
0
    def test_script_scan_dependencies(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '06-scan-dependencies'))
        info = script.extract_from(group='scan-dependencies')

        assert (info == [])
Пример #6
0
    def test_script_benchmarks(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '03-benchmarks'))
        info = script.extract_from(group='benchmarks')

        assert (info == {})
Пример #7
0
    def test_meson_test(self):
        script: MesonScriptReader = MesonScriptReader(
            join('test-cases', 'intro-scanner', '02-unittests'))
        info = script.extract_from(group='tests')

        assert (info == {})