From a8cd01af42a0e114e5184c845aa2cd6dd3eaeac0 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 20 Feb 2020 19:24:34 +0000 Subject: Extend unit test to cover cwd-relative warning location formatting --- run_unittests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/run_unittests.py b/run_unittests.py index 2e32b5177..d091cbcca 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3172,6 +3172,20 @@ int main(int argc, char **argv) { ]: self.assertRegex(out, re.escape(expected)) + for wd in [ + self.src_root, + self.builddir, + os.getcwd(), + ]: + self.new_builddir() + out = self.init(tdir, workdir=wd) + expected = os.path.join(relpath(tdir, self.src_root), 'meson.build') + relwd = relpath(self.src_root, wd) + if relwd != '.': + expected = os.path.join(relwd, expected) + expected = '\n' + expected + ':' + self.assertIn(expected, out) + def test_error_location_path(self): '''Test locations in meson errors contain correct paths''' # this list contains errors from all the different steps in the -- cgit v1.2.3