diff options
author | Igor Gnatenko <ignatenko@redhat.com> | 2017-06-19 11:17:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 11:17:53 +0200 |
commit | f8c46951ef7ffb26ff1cdc4aa7fb4d59586d76e7 (patch) | |
tree | 9f2c80b445c5e516425923058e1bb977f2c4440b | |
parent | 3bc7651907e81cacb93f2f160b720dc97b958f05 (diff) | |
parent | c3591e5303099a69e7ff5742bc1541dd2e7734ec (diff) | |
download | meson-f8c46951ef7ffb26ff1cdc4aa7fb4d59586d76e7.zip meson-f8c46951ef7ffb26ff1cdc4aa7fb4d59586d76e7.tar.gz meson-f8c46951ef7ffb26ff1cdc4aa7fb4d59586d76e7.tar.bz2 |
Merge pull request #1956 from mesonbuild/fix1934
Handle both pkg-config and pkgconf argument order. Closes #1934.
-rwxr-xr-x | run_unittests.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/run_unittests.py b/run_unittests.py index 61dc0ee..95f418d 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1770,16 +1770,22 @@ class LinuxlikeTests(BasePlatformTests): self.init(testdir) # NOTE: .pc file has -Lfoo -lfoo -Lbar -lbar but pkg-config reorders # the flags before returning them to -Lfoo -Lbar -lfoo -lbar - expected_order = ['-L/me/first', '-L/me/second','-lfoo1', '-lfoo2', - '-L/me/third', '-L/me/fourth', '-lfoo3', '-lfoo4'] + # but pkgconf seems to not do that. Sigh. Support both. + expected_order = [('-L/me/first', '-lfoo1'), + ('-L/me/second', '-lfoo2'), + ('-L/me/first', '-L/me/second'), + ('-lfoo1', '-lfoo2'), + ('-L/me/second', '-L/me/third'), + ('-L/me/third', '-L/me/fourth',), + ('-L/me/third', '-lfoo3'), + ('-L/me/fourth', '-lfoo4'), + ('-lfoo3', '-lfoo4'), + ] with open(os.path.join(self.builddir, 'build.ninja')) as ifile: for line in ifile: - if expected_order[0] in line: - previous_index = line.index(expected_order[0]) - for entry in expected_order[1:]: - current_index = line.index(entry) - self.assertLess(previous_index, current_index) - previous_index = current_index + if expected_order[0][0] in line: + for first, second in expected_order: + self.assertLess(line.index(first), line.index(second)) return raise RuntimeError('Linker entries not found in the Ninja file.') |