aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2022-03-29 23:59:44 +0200
committerXavier Claessens <xclaesse@gmail.com>2022-03-30 06:57:30 -0400
commit2cdddbab56ffdbca6accfc626521968fbe2c917e (patch)
tree16a0fd27f509d7a4ae0dd41fdd8eeaaa1a679a76 /unittests
parent969ae6e0e1ffe3d1acb6ef0ef93c809b566a3ea1 (diff)
downloadmeson-2cdddbab56ffdbca6accfc626521968fbe2c917e.zip
meson-2cdddbab56ffdbca6accfc626521968fbe2c917e.tar.gz
meson-2cdddbab56ffdbca6accfc626521968fbe2c917e.tar.bz2
Add new debug() function
Adds a new debug() function that can be used in the meson.build to log messages to the meson-log.txt that will not be printed to stdout when configuring the project.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/platformagnostictests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py
index b5907a1..6e0951f 100644
--- a/unittests/platformagnostictests.py
+++ b/unittests/platformagnostictests.py
@@ -70,3 +70,16 @@ class PlatformAgnosticTests(BasePlatformTests):
def test_python_dependency_without_pkgconfig(self):
testdir = os.path.join(self.unit_test_dir, '102 python without pkgconfig')
self.init(testdir, override_envvars={'PKG_CONFIG': 'notfound'})
+
+ def test_debug_function_outputs_to_meson_log(self):
+ testdir = os.path.join(self.unit_test_dir, '104 debug function')
+ log_msg = 'This is an example debug output, should only end up in debug log'
+ output = self.init(testdir)
+
+ # Check if message is not printed to stdout while configuring
+ assert(log_msg not in output)
+
+ # Check if message is written to the meson log
+ mesonlog = os.path.join(self.builddir, 'meson-logs/meson-log.txt')
+ with open(mesonlog, mode='r', encoding='utf-8') as file:
+ assert(log_msg in file.read())