diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-18 23:42:01 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-18 23:46:37 +0300 |
commit | c3591e5303099a69e7ff5742bc1541dd2e7734ec (patch) | |
tree | 9f2c80b445c5e516425923058e1bb977f2c4440b | |
parent | 3bc7651907e81cacb93f2f160b720dc97b958f05 (diff) | |
download | meson-c3591e5303099a69e7ff5742bc1541dd2e7734ec.zip meson-c3591e5303099a69e7ff5742bc1541dd2e7734ec.tar.gz meson-c3591e5303099a69e7ff5742bc1541dd2e7734ec.tar.bz2 |
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.') |