[gtk-mac-bundler: 6/12] [tests] Repair and improve testing the launcher script element.




commit 720a0c22c333d08141b56120524f2a80ae34ea5a
Author: John Ralls <jralls ceridwen us>
Date:   Mon Jul 18 12:02:19 2022 -0700

    [tests] Repair and improve testing the launcher script element.

 bundler/project_test.py | 15 +++++++++------
 test/goodproject.bundle |  4 ++++
 test/launcher.sh        |  4 ++++
 3 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/bundler/project_test.py b/bundler/project_test.py
index 0ff9179..2202f4c 100644
--- a/bundler/project_test.py
+++ b/bundler/project_test.py
@@ -118,12 +118,15 @@ class Project_Test(unittest.TestCase):
                              "Prefix path evaluation failed %s" % path)
 
     def test_i_get_launcher_script(self):
-        path = self.goodproject.get_launcher_script()
-        self.failUnlessEqual(path.source, 
-                    os.path.join(os.path.dirname(__file__), "launcher.sh"),
-                    "Bad launcher source")
-        self.failUnlessEqual(path.dest, "${bundle}/Contents/MacOS/${name}",
-                    "Bad launcher destination")
+        launcher_path = self.goodproject.get_launcher_script()
+        proj_dir = self.goodproject.get_project_dir();
+        path = self.goodproject.evaluate_path(launcher_path.source)
+        self.failUnlessEqual(path,
+                             os.path.join(proj_dir, "launcher.sh"),
+                             "Bad launcher source")
+        self.failUnlessEqual(launcher_path.dest,
+                             "${bundle}/Contents/MacOS/${name}",
+                             "Bad launcher destination")
 
     def test_j_get_icon_themes(self):
         themes = self.goodproject.get_icon_themes()
diff --git a/test/goodproject.bundle b/test/goodproject.bundle
index 021e7a6..75114c0 100644
--- a/test/goodproject.bundle
+++ b/test/goodproject.bundle
@@ -5,6 +5,10 @@
     <prefix name="alt">/usr/local/gtk</prefix>
     <run-install-name-tool/>
     <image>foo-version.dmg</image>
+    <launcher-script>
+      ${project}/launcher.sh
+    </launcher-script>
+    <gtk>gtk+-3.0</gtk>
   </meta>
   <plist>${project}/test.plist</plist>
   <environment>
diff --git a/test/launcher.sh b/test/launcher.sh
new file mode 100644
index 0000000..2fb6cec
--- /dev/null
+++ b/test/launcher.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+# This is a placeholder launcher script to test the default path. For
+# a functional example please see the examples directory.
+echo $0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]