From dd1de073f4c9e643090b1cfdcbfb6b25bbd9dc49 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 30 Dec 2017 18:34:08 +0000 Subject: [PATCH] Add a test case for location in duplicate kwarg warning --- run_unittests.py | 6 ++++++ test cases/unit/20 warning location/a.c | 0 test cases/unit/20 warning location/b.c | 0 test cases/unit/20 warning location/main.c | 0 test cases/unit/20 warning location/meson.build | 5 +++++ test cases/unit/20 warning location/sub/c.c | 0 test cases/unit/20 warning location/sub/d.c | 0 test cases/unit/20 warning location/sub/meson.build | 3 +++ test cases/unit/20 warning location/sub/sub.c | 0 9 files changed, 14 insertions(+) create mode 100644 test cases/unit/20 warning location/a.c create mode 100644 test cases/unit/20 warning location/b.c create mode 100644 test cases/unit/20 warning location/main.c create mode 100644 test cases/unit/20 warning location/meson.build create mode 100644 test cases/unit/20 warning location/sub/c.c create mode 100644 test cases/unit/20 warning location/sub/d.c create mode 100644 test cases/unit/20 warning location/sub/meson.build create mode 100644 test cases/unit/20 warning location/sub/sub.c diff --git a/run_unittests.py b/run_unittests.py index cf229dae0..036ddd2c8 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1707,6 +1707,12 @@ int main(int argc, char **argv) { self.init(workdir) self.build() + def test_warning_location(self): + tdir = os.path.join(self.unit_test_dir, '20 warning location') + out = self.init(tdir) + self.assertRegex(out, r'WARNING: Keyword argument "link_with" defined multiple times in file meson.build, line 4') + self.assertRegex(out, r'WARNING: Keyword argument "link_with" defined multiple times in file sub' + re.escape(os.path.sep) + r'meson.build, line 3') + class FailureTests(BasePlatformTests): ''' diff --git a/test cases/unit/20 warning location/a.c b/test cases/unit/20 warning location/a.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/20 warning location/b.c b/test cases/unit/20 warning location/b.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/20 warning location/main.c b/test cases/unit/20 warning location/main.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/20 warning location/meson.build b/test cases/unit/20 warning location/meson.build new file mode 100644 index 000000000..7a2e5a7bd --- /dev/null +++ b/test cases/unit/20 warning location/meson.build @@ -0,0 +1,5 @@ +project('duplicate kwarg', 'c') +a = library('liba', 'a.c') +b = library('libb', 'b.c') +executable('main', 'main.c', link_with: a, link_with: b) +subdir('sub') diff --git a/test cases/unit/20 warning location/sub/c.c b/test cases/unit/20 warning location/sub/c.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/20 warning location/sub/d.c b/test cases/unit/20 warning location/sub/d.c new file mode 100644 index 000000000..e69de29bb diff --git a/test cases/unit/20 warning location/sub/meson.build b/test cases/unit/20 warning location/sub/meson.build new file mode 100644 index 000000000..c23d8e7ab --- /dev/null +++ b/test cases/unit/20 warning location/sub/meson.build @@ -0,0 +1,3 @@ +c = library('libc', 'c.c') +d = library('libd', 'd.c') +executable('sub', 'sub.c', link_with: c, link_with: d) diff --git a/test cases/unit/20 warning location/sub/sub.c b/test cases/unit/20 warning location/sub/sub.c new file mode 100644 index 000000000..e69de29bb