diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-03-18 14:23:06 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-20 18:45:56 +0200 |
commit | ac627bcea723b12e17822c18cccc9dbdeaee8b8f (patch) | |
tree | 66999769a73d0f923389f1d2ddec898421a204a1 /run_unittests.py | |
parent | 44dd5535f056922294867bac2eb07b57f21bede6 (diff) | |
download | meson-ac627bcea723b12e17822c18cccc9dbdeaee8b8f.zip meson-ac627bcea723b12e17822c18cccc9dbdeaee8b8f.tar.gz meson-ac627bcea723b12e17822c18cccc9dbdeaee8b8f.tar.bz2 |
replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/run_unittests.py b/run_unittests.py index 0b2164f..1763c7a 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -47,7 +47,7 @@ from mesonbuild.ast import AstInterpreter from mesonbuild.mesonlib import ( is_windows, is_osx, is_cygwin, is_dragonflybsd, is_openbsd, is_haiku, windows_proof_rmtree, python_command, version_compare, - BuildDirLock, Version, PerMachine + BuildDirLock, Version, PerMachine, LibType ) from mesonbuild.environment import detect_ninja from mesonbuild.mesonlib import MesonException, EnvironmentException @@ -702,13 +702,13 @@ class InternalTests(unittest.TestCase): stc = patterns[platform]['static'] shrstc = shr + tuple([x for x in stc if x not in shr]) stcshr = stc + tuple([x for x in shr if x not in stc]) - p = cc.get_library_naming(env, 'shared') + p = cc.get_library_naming(env, LibType.SHARED) self.assertEqual(p, shr) - p = cc.get_library_naming(env, 'static') + p = cc.get_library_naming(env, LibType.STATIC) self.assertEqual(p, stc) - p = cc.get_library_naming(env, 'static-shared') + p = cc.get_library_naming(env, LibType.PREFER_STATIC) self.assertEqual(p, stcshr) - p = cc.get_library_naming(env, 'shared-static') + p = cc.get_library_naming(env, LibType.PREFER_SHARED) self.assertEqual(p, shrstc) # Test find library by mocking up openbsd if platform != 'openbsd': @@ -724,7 +724,7 @@ class InternalTests(unittest.TestCase): f.write('') with open(os.path.join(tmpdir, 'libfoo.so.70.0.so.1'), 'w') as f: f.write('') - found = cc.find_library_real('foo', env, [tmpdir], '', 'shared-static') + found = cc.find_library_real('foo', env, [tmpdir], '', LibType.PREFER_SHARED) self.assertEqual(os.path.basename(found[0]), 'libfoo.so.54.0') def test_find_library_patterns(self): |