}
+
} else {
args += pr.firstBuildModule();
}
- //args += "--output";
+ //args += "--output"; -- set up by the module -- defaults to testrun
//args += "/tmp/testrun";
// assume code is in home...
* Used to compile a non builder file..
*/
- public bool checkPlainFileSpawn( JsRender.JsRender file, string contents )
+
+ public bool checkPlainFileSpawn( JsRender.JsRender file, string contents )
+
{
// race condition..
if (this.compiler != null) {
DataOutputStream dostream = new DataOutputStream (ostream);
dostream.put_string (contents);
+ var target = pr.firstBuildModule();
+ if (target.length < 1) {
+ return false;
+ }
this.file = null;
this.line_offset = 0;
args += "--project";
args += file.project.fn;
args += "--target";
+
args += pr.firstBuildModule();
args += "--add-file";
args += tmpfile.get_path();
return true;
}
-
+
public void spawnResult(int res, string output, string stderr)
{
public void runResult(int res, string output, string stderr)
{
this.compiler = null;
- if (!GLib.FileUtils.test("/tmp/testrun", GLib.FileTest.EXISTS)) {
- print("Missing outfile\n");
+ var exe = "/tmp/testrun";
+ var mod = "";
+ var pr = (Project.Gtk)(this.file.project);
+
+
+
+ if (this.file.build_module.length > 0 ) {
+ mod = this.file.build_module;
+ } else {
+ mod = pr.firstBuildModule();
+ }
+ if (mod.length < 1) {
+ return;
+ }
+ var cg = pr.compilegroups.get(mod);
+ if (cg.target_bin.length > 0) {
+ exe = cg.target_bin;
+ }
+
+
+ if (!GLib.FileUtils.test(exe, GLib.FileTest.EXISTS)) {
+ print("Missing output file: %s\n",exe);
return;
}
+ string[] args = "/usr/bin/gnome-terminal -x /usr/bin/gdb -ex=r --args".split(" ");
+
+
+ // runs gnome-terminal, with gdb .. running the application..
+ // fixme -- need a system/which
- print("OUT: %s\n\n----\nERR:%s", output, stderr);
- var exec = new Spawn("/tmp", { "/tmp/testrun" });
+ args += exe;
+ if (cg.execute_args.length > 0) {
+ var aa = cg.execute_args.split(" ");
+ for (var i =0; i < aa.length; i++) {
+ args += aa[i];
+ }
+ }
+
+ print("OUT: %s\n\n----\nERR:%s\n", output, stderr);
+
+ // should be home directory...
+
+
+
+ var exec = new Spawn(GLib.Environment.get_home_dir() , args);
exec.detach = true;
exec.run();