From a04954f2ecdf2da624ba24352981db11fb2b6a14 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 5 Feb 2012 17:38:18 +1000 Subject: Tell the scripts to quit after a short delay. --- LuaSL/src/LuaSL_main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'LuaSL/src/LuaSL_main.c') diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index f233031..5f48c5e 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c @@ -109,6 +109,27 @@ static void dirList_run(const char *name, const char *path, void *data) } } +static void dirList_quit(const char *name, const char *path, void *data) +{ + gameGlobals *game = data; + char buf[PATH_MAX]; + char *ext = rindex(name, '.'); + + if (ext) + { + if (0 == strcmp(ext, ".out")) + { + const char *status = NULL; + + snprintf(buf, sizeof(buf), "%s/%s.events", path, name); +// PD("Quitting Lua script %s", buf); + status = sendToChannel(buf, "quit()"); + if (status) + PE("Error trying to kill script %s : %s", buf, status); + } + } +} + int main(int argc, char **argv) { @@ -258,6 +279,13 @@ main(int argc, char **argv) ecore_animator_del(ani); ecore_evas_free(game.ee); } + else + { + // Wait awhile, then quit all scripts we started, for testing. + sleep(2); + snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); + eina_file_dir_list(buf, EINA_TRUE, dirList_quit, &game); + } runnerTearDown(&game); edje_shutdown(); -- cgit v1.1