summaryrefslogtreecommitdiffstats
path: root/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/mozbuild/mozbuild/test/backend/test_recursivemake.py')
-rw-r--r--python/mozbuild/mozbuild/test/backend/test_recursivemake.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
index 0706a302bf..a120ff81ce 100644
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -1203,23 +1203,23 @@ class TestRecursiveMakeBackend(BackendTester):
env = self._consume("linkage", RecursiveMakeBackend)
expected_linkage = {
"prog": {
- "SHARED_LIBS": ["qux/qux.so", "../shared/baz.so"],
+ "SHARED_LIBS": ["../dist/bin/qux.so", "../dist/bin/baz.so"],
"STATIC_LIBS": ["../real/foo.a"],
"OS_LIBS": ["-lfoo", "-lbaz", "-lbar"],
},
"shared": {
"OS_LIBS": ["-lfoo"],
- "SHARED_LIBS": ["../prog/qux/qux.so"],
+ "SHARED_LIBS": ["../dist/bin/qux.so"],
"STATIC_LIBS": [],
},
"static": {
"STATIC_LIBS": ["../real/foo.a"],
"OS_LIBS": ["-lbar"],
- "SHARED_LIBS": ["../prog/qux/qux.so"],
+ "SHARED_LIBS": ["../dist/bin/qux.so"],
},
"real": {
"STATIC_LIBS": [],
- "SHARED_LIBS": ["../prog/qux/qux.so"],
+ "SHARED_LIBS": ["../dist/bin/qux.so"],
"OS_LIBS": ["-lbaz"],
},
}
@@ -1326,6 +1326,28 @@ class TestRecursiveMakeBackend(BackendTester):
][0]
self.assertEqual(program, expected_program)
+ def test_shared_lib_paths(self):
+ """SHARED_LIBRARYs with various moz.build settings that change the destination should
+ produce the expected paths in backend.mk."""
+ env = self._consume("shared-lib-paths", RecursiveMakeBackend)
+
+ expected = [
+ ("dist-bin", "$(DEPTH)/dist/bin/libdist-bin.so"),
+ ("dist-subdir", "$(DEPTH)/dist/bin/foo/libdist-subdir.so"),
+ ("final-target", "$(DEPTH)/final/target/libfinal-target.so"),
+ ("not-installed", "libnot-installed.so"),
+ ]
+ prefix = "SHARED_LIBRARY := "
+ for subdir, expected_shared_lib in expected:
+ with io.open(os.path.join(env.topobjdir, subdir, "backend.mk"), "r") as fh:
+ lines = fh.readlines()
+ shared_lib = [
+ line.rstrip().split(prefix, 1)[1]
+ for line in lines
+ if line.startswith(prefix)
+ ][0]
+ self.assertEqual(shared_lib, expected_shared_lib)
+
if __name__ == "__main__":
main()