X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=tests%2FValaTest.vala;h=2a7ec4c4c1f97a3ff4cfc63f46f944bde0dbc23e;hb=b28112d39ef063f657d5b18a42d5e5a904855c88;hp=83333c7b9ccd22aae1b1916defd19ffa544ca482;hpb=5bb46e73d46419a75d19447d23f5593da18ea3d6;p=app.Builder.js diff --git a/tests/ValaTest.vala b/tests/ValaTest.vala index 83333c7b9..2a7ec4c4c 100644 --- a/tests/ValaTest.vala +++ b/tests/ValaTest.vala @@ -3,7 +3,31 @@ */ - + + +void diff(string original, string data) +{ + + FileUtils.set_contents("/tmp/test.out",data); + string[] spawn_args = {"diff", "-w" , "-u", original, "/tmp/test.out" }; + + + string[] spawn_env = Environ.get (); + int ls_status; + Process.spawn_sync ("/", + spawn_args, + spawn_env, + SpawnFlags.SEARCH_PATH, + null, + null, + null, + out ls_status); + + +} + + + int main (string[] args) { Gtk.init (ref args); //GtkClutter.init (ref args); @@ -11,13 +35,40 @@ int main (string[] args) { GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); - //var g = Palete.Gir.factory("Gtk"); - //var test = g.classes.get("Label"); + Project.Project.loadAll(); + var p = Project.Project.getProject("Builder4"); + p.scanDirs(); + var ar = p.sortedFiles(); + var iter = ar.list_iterator(); + while (iter.next()) { + var f= iter.get(); + f.loadItems(); + + // syntax check.. + var a = new Palete.ValaSource(f); + + + + //print("\n%s\n",f.toJsonString()); + //diff(p.firstPath() + "/" + f.name + ".vala", JsRender.NodeToVala.mungeFile(f)); + //var str= + //print("\n%s\n",str); + //return 0; + } + + + return 0; +} + + +void testGir() { + + var test = Palete.Gir.factoryFqn("Gtk.Label.new"); if (test == null) { print("could not find Gtk.Label.new\n"); - return 0; + return; } @@ -29,19 +80,5 @@ int main (string[] args) { generator.pretty = true; print(generator.to_data(null)); - return 0; - - Project.Project.loadAll(); - var p = Project.Project.getProject("BuilderTest"); - p.scanDirs(); - var ar = p.sortedFiles(); - var iter = ar.list_iterator(); - while (iter.next()) { - var f= iter.get(); - f.save(); - } - - - return 0; -} +} \ No newline at end of file