aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-11-29 03:38:06 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-12-04 00:34:53 +0530
commitae8c4f5a3078ad74d9d05eeddeb9c726b83863b8 (patch)
tree01943256235deb3f2fac1954a2f6a0f58930a3ae /run_unittests.py
parent025d699c002ab9e0c1823dce3e526b70c0fc2280 (diff)
downloadmeson-ae8c4f5a3078ad74d9d05eeddeb9c726b83863b8.zip
meson-ae8c4f5a3078ad74d9d05eeddeb9c726b83863b8.tar.gz
meson-ae8c4f5a3078ad74d9d05eeddeb9c726b83863b8.tar.bz2
run_unittests: Document the purpose of each test
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index cc105f2..03ce0df 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -111,6 +111,12 @@ class LinuxlikeTests(unittest.TestCase):
return json.loads(out)
def test_basic_soname(self):
+ '''
+ Test that the soname is set correctly for shared libraries. This can't
+ be an ordinary test case because we need to run `readelf` and actually
+ check the soname.
+ https://github.com/mesonbuild/meson/issues/785
+ '''
testdir = os.path.join(self.common_test_dir, '4 shared')
self.init(testdir)
self.build()
@@ -119,6 +125,12 @@ class LinuxlikeTests(unittest.TestCase):
self.assertEqual(soname, 'libmylib.so')
def test_custom_soname(self):
+ '''
+ Test that the soname is set correctly for shared libraries when
+ a custom prefix and/or suffix is used. This can't be an ordinary test
+ case because we need to run `readelf` and actually check the soname.
+ https://github.com/mesonbuild/meson/issues/785
+ '''
testdir = os.path.join(self.common_test_dir, '27 library versions')
self.init(testdir)
self.build()
@@ -127,6 +139,11 @@ class LinuxlikeTests(unittest.TestCase):
self.assertEqual(soname, 'prefixsomelib.suffix')
def test_pic(self):
+ '''
+ Test that -fPIC is correctly added to static libraries when b_staticpic
+ is true and not when it is false. This can't be an ordinary test case
+ because we need to inspect the compiler database.
+ '''
testdir = os.path.join(self.common_test_dir, '3 static')
self.init(testdir)
compdb = self.get_compdb()
@@ -142,6 +159,12 @@ class LinuxlikeTests(unittest.TestCase):
self.assertTrue('-fPIC' not in compdb[0]['command'])
def test_pkgconfig_gen(self):
+ '''
+ Test that generated pkg-config files can be found and have the correct
+ version and link args. This can't be an ordinary test case because we
+ need to run pkg-config outside of a Meson build file.
+ https://github.com/mesonbuild/meson/issues/889
+ '''
testdir = os.path.join(self.common_test_dir, '51 pkgconfig-gen')
self.init(testdir)
env = FakeEnvironment()
@@ -153,6 +176,12 @@ class LinuxlikeTests(unittest.TestCase):
self.assertTrue('-lfoo' in simple_dep.get_link_args())
def test_vala_c_warnings(self):
+ '''
+ Test that no warnings are emitted for C code generated by Vala. This
+ can't be an ordinary test case because we need to inspect the compiler
+ database.
+ https://github.com/mesonbuild/meson/issues/864
+ '''
testdir = os.path.join(self.vala_test_dir, '5 target glib')
self.init(testdir)
compdb = self.get_compdb()
@@ -180,6 +209,12 @@ class LinuxlikeTests(unittest.TestCase):
self.assertTrue('-Werror' in c_command)
def test_static_compile_order(self):
+ '''
+ Test that the order of files in a compiler command-line while compiling
+ and linking statically is deterministic. This can't be an ordinary test
+ case because we need to inspect the compiler database.
+ https://github.com/mesonbuild/meson/pull/951
+ '''
testdir = os.path.join(self.common_test_dir, '5 linkstatic')
self.init(testdir)
compdb = self.get_compdb()
@@ -191,6 +226,10 @@ class LinuxlikeTests(unittest.TestCase):
# FIXME: We don't have access to the linker command
def test_install_introspection(self):
+ '''
+ Tests that the Meson introspection API exposes install filenames correctly
+ https://github.com/mesonbuild/meson/issues/829
+ '''
testdir = os.path.join(self.common_test_dir, '8 install')
self.init(testdir)
intro = self.introspect('--targets')
@@ -200,11 +239,19 @@ class LinuxlikeTests(unittest.TestCase):
self.assertEqual(intro[1]['install_filename'], '/usr/local/bin/prog')
def test_run_target_files_path(self):
+ '''
+ Test that run_targets are run from the correct directory
+ https://github.com/mesonbuild/meson/issues/957
+ '''
testdir = os.path.join(self.common_test_dir, '58 run target')
self.init(testdir)
self.run_target('check_exists')
def test_qt5dependency_qmake_detection(self):
+ '''
+ Test that qt5 detection with qmake works. This can't be an ordinary
+ test case because it involves setting the environment.
+ '''
# Verify that qmake is for Qt5
if not shutil.which('qmake-qt5'):
if not shutil.which('qmake'):