Skip to content

Commit

Permalink
fix for hang if max app is not in front in some cases (e.g. running o…
Browse files Browse the repository at this point in the history
…n travis-ci). also more verbose output to the console while running.
  • Loading branch information
Timothy Place committed Aug 24, 2016
1 parent fc41c8b commit 84ff626
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ruby/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def waitForAllTestCompletion
@testCompleted = 0

@oscReceiver.add_method('/test/all/complete', '') do |msg|
puts " all tests completed"
@testCompleted = 1
end

Expand All @@ -158,6 +159,20 @@ def launchMax
else
IO.popen("#{@maxfolder}/Max.exe")
end

@oscReceiver.add_method('/db/log', 's') do |msg|
puts " #{msg.args[0]}"

# on the mac things can stall out if Max is not made the front-most application
if RUBY_PLATFORM.match(/darwin/)
if @maxfolder.match(/\.app\/*$/) # check if app name given directly
`open "#{@maxfolder}"`
else # nope, just a folder name, so assume Max.app
`open "#{@maxfolder}/Max.app"`
end
end

end
end


Expand Down
9 changes: 8 additions & 1 deletion source/oscar/test.db.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,16 @@ void testdb_log(t_testdb *d, long test_id, const char* text, ...)
t_datetime datetime;
va_list ap;
char expandedtext[2048];

va_start(ap, text);
vsnprintf(expandedtext, 2048, text, ap);

{
t_atom a;
atom_setsym(&a, gensym(expandedtext));
testport_send((t_testport*)ps_testport->s_thing, gensym("/db/log"), 1, &a);
}

systime_secondstodate(timestamp, &datetime);
db_query(d->d_db, NULL, "INSERT INTO logs ( test_id_ext , text , timestamp ) \
VALUES ( %i , \"%s\" , '%4u-%02u-%02u %02u:%02u:%02u' )",
Expand Down

0 comments on commit 84ff626

Please sign in to comment.