[vala/wip/valadate: 56/101] added search for GIR files



commit ebe04b56ab6416d272b77ae3694d8aba2b4b260d
Author: chebizarro gmail com <chebizarro gmail com>
Date:   Sat Jul 9 11:52:37 2016 -0700

    added search for GIR files

 tests/valatests.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/valatests.vala b/tests/valatests.vala
index a28a463..1e9cbae 100644
--- a/tests/valatests.vala
+++ b/tests/valatests.vala
@@ -241,6 +241,12 @@ namespace Vala.Tests {
                                case "GIR":
 
                                        string gir = "";
+                                       string girdirs = "";
+                                       
+                                       foreach(string dir in GLib.Environment.get_system_data_dirs())
+                                               if(File.new_for_path(dir).get_child("gir-1.0").query_exists())
+                                                       girdirs += 
"--girdir=%s/gir-1.0".printf(File.new_for_path(dir).get_child("gir-1.0").get_path());
+                                       
                                        string vapi = "/* %s.vapi generated by lt-vapigen, do not modify. 
*/\n\n".printf(testname);
                                        vapi += "[CCode (cprefix = \"Test\", gir_namespace = \"Test\", 
gir_version = \"1.2\", lower_case_cprefix = \"test_\")]";
                                        vapi += "\nnamespace Test {";
@@ -264,7 +270,7 @@ namespace Vala.Tests {
                                        var girstream = girfile.create(FileCreateFlags.NONE);
                                        girstream.write(GIRHEADER.printf(gir).data);
 
-                                       string command = "%s %s --library %s %s".printf(vapigen.get_path(), 
vapidirs, testname, girfile.get_path());
+                                       string command = "%s %s %s --library %s 
%s".printf(vapigen.get_path(), vapidirs, girdirs, testname, girfile.get_path());
                                
                                        run_command(command);
 


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