Merge lp:~jamesh/libunity/scope-loader-dash-m into lp:libunity

Proposed by James Henstridge
Status: Merged
Approved by: Michal Hruby
Approved revision: 258
Merged at revision: 259
Proposed branch: lp:~jamesh/libunity/scope-loader-dash-m
Merge into: lp:libunity
Diff against target: 33 lines (+9/-0)
1 file modified
loader/scope-loader.vala (+9/-0)
To merge this branch: bzr merge lp:~jamesh/libunity/scope-loader-dash-m
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+175237@code.launchpad.net

Commit message

Add a '-m' flag to unity-scope-loader to help with testing not-yet-installed scopes.

Description of the change

Add a '-m' flag to unity-scope-loader, similar to the Python scope loader.

This takes a shared library as an argument and loads the scope(s) from that library directly rather than going indirect through a scope or group file. This is intended to help developers test their scopes in-tree, so they don't need to have a scope file that points at the copy of the library in their build tree in order to test the code prior to installation.

It is not intended for use with installed code, as mentioned in the help text.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

Looks fine, but we should make sure this is really only used for testing, not in production.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loader/scope-loader.vala'
2--- loader/scope-loader.vala 2013-07-01 09:58:31 +0000
3+++ loader/scope-loader.vala 2013-07-17 09:50:46 +0000
4@@ -3,6 +3,7 @@
5 namespace Options
6 {
7 private static string group;
8+ private static string module;
9 }
10
11 const OptionEntry[] options =
12@@ -12,6 +13,10 @@
13 "Scope group configuration", null
14 },
15 {
16+ "module", 'm', 0, OptionArg.STRING, out Options.module,
17+ "Scope shared library (for testing)", null
18+ },
19+ {
20 null
21 }
22 };
23@@ -36,6 +41,10 @@
24 {
25 loader.load_group (Options.group);
26 }
27+ else if (Options.module != null)
28+ {
29+ loader.load_module (Options.module, "C");
30+ }
31 else
32 {
33 for (var i = 1; i < args.length; i++)

Subscribers

People subscribed via source and target branches