diff options
author | David Walter Seikel | 2012-01-23 23:01:00 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:01:00 +1000 |
commit | 27ff172c200a3766094a6d51e78535e2394b0f4f (patch) | |
tree | 27cb04d73577b8917b34c129c559fa9e48fa763c | |
parent | Tweaked the output a little. (diff) | |
download | SledjHamr-27ff172c200a3766094a6d51e78535e2394b0f4f.zip SledjHamr-27ff172c200a3766094a6d51e78535e2394b0f4f.tar.gz SledjHamr-27ff172c200a3766094a6d51e78535e2394b0f4f.tar.bz2 SledjHamr-27ff172c200a3766094a6d51e78535e2394b0f4f.tar.xz |
Add ability to disable the test harness, or the Lua compile test.
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index 4bd3bc5..2f5e770 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -1,8 +1,11 @@ | |||
1 | #include "LuaSL.h" | 1 | #include "LuaSL.h" |
2 | 2 | ||
3 | #define HARNESS 0 | ||
4 | #define LUA_TEST 0 | ||
5 | |||
3 | static int scriptCount; | 6 | static int scriptCount; |
4 | 7 | ||
5 | #if 0 | 8 | #if HARNESS |
6 | static const char *names[] = | 9 | static const char *names[] = |
7 | { | 10 | { |
8 | "bub1", "sh1", | 11 | "bub1", "sh1", |
@@ -69,7 +72,7 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
69 | } | 72 | } |
70 | #endif | 73 | #endif |
71 | 74 | ||
72 | void dirList_cb(const char *name, const char *path, void *data) | 75 | static void dirList_cb(const char *name, const char *path, void *data) |
73 | { | 76 | { |
74 | gameGlobals *game = data; | 77 | gameGlobals *game = data; |
75 | char buf[PATH_MAX]; | 78 | char buf[PATH_MAX]; |
@@ -90,7 +93,8 @@ void dirList_cb(const char *name, const char *path, void *data) | |||
90 | } | 93 | } |
91 | } | 94 | } |
92 | 95 | ||
93 | void dirListLua_cb(const char *name, const char *path, void *data) | 96 | #if LUA_TEST |
97 | static void dirListLua_cb(const char *name, const char *path, void *data) | ||
94 | { | 98 | { |
95 | char buf[PATH_MAX]; | 99 | char buf[PATH_MAX]; |
96 | char *ext = rindex(name, '.'); | 100 | char *ext = rindex(name, '.'); |
@@ -105,6 +109,7 @@ void dirListLua_cb(const char *name, const char *path, void *data) | |||
105 | } | 109 | } |
106 | } | 110 | } |
107 | } | 111 | } |
112 | #endif | ||
108 | 113 | ||
109 | int | 114 | int |
110 | main(int argc, char **argv) | 115 | main(int argc, char **argv) |
@@ -128,11 +133,14 @@ main(int argc, char **argv) | |||
128 | // else if ((game.config) && (game.data)) | 133 | // else if ((game.config) && (game.data)) |
129 | { | 134 | { |
130 | char buf[PATH_MAX]; | 135 | char buf[PATH_MAX]; |
131 | unsigned int lslCount; | ||
132 | struct timeval lastTime2; | 136 | struct timeval lastTime2; |
133 | struct timeval thisTime2; | 137 | struct timeval thisTime2; |
134 | float diff0, diff; | 138 | float diff; |
135 | #if 0 | 139 | #if LUA_TEST |
140 | unsigned int lslCount; | ||
141 | float diff0; | ||
142 | #endif | ||
143 | #if HARNESS | ||
136 | unsigned int i; | 144 | unsigned int i; |
137 | char *group = "main"; | 145 | char *group = "main"; |
138 | Evas_Object *bub, *sh; | 146 | Evas_Object *bub, *sh; |
@@ -214,6 +222,7 @@ main(int argc, char **argv) | |||
214 | diff = timeDiff(&thisTime2, &lastTime2); | 222 | diff = timeDiff(&thisTime2, &lastTime2); |
215 | printf("Compiling %d LSL scripts took %f seconds, that's %f scripts per second.\n", scriptCount, diff, scriptCount / diff); | 223 | printf("Compiling %d LSL scripts took %f seconds, that's %f scripts per second.\n", scriptCount, diff, scriptCount / diff); |
216 | 224 | ||
225 | #if LUA_TEST | ||
217 | lslCount = scriptCount; | 226 | lslCount = scriptCount; |
218 | diff0 = diff; | 227 | diff0 = diff; |
219 | scriptCount = 0; | 228 | scriptCount = 0; |
@@ -224,10 +233,11 @@ main(int argc, char **argv) | |||
224 | printf("Compiling %d Lua scripts took %f seconds, that's %f scripts per second.\n\n", scriptCount, diff, scriptCount / diff); | 233 | printf("Compiling %d Lua scripts took %f seconds, that's %f scripts per second.\n\n", scriptCount, diff, scriptCount / diff); |
225 | 234 | ||
226 | printf("Combined estimate of compiling speed is %f scripts per second.\n", 1 / ((diff0 / lslCount) + (diff / scriptCount))); | 235 | printf("Combined estimate of compiling speed is %f scripts per second.\n", 1 / ((diff0 / lslCount) + (diff / scriptCount))); |
236 | #endif | ||
227 | 237 | ||
228 | // ecore_main_loop_begin(); | 238 | // ecore_main_loop_begin(); |
229 | 239 | ||
230 | #if 0 | 240 | #if HARNESS |
231 | ecore_animator_del(ani); | 241 | ecore_animator_del(ani); |
232 | ecore_evas_free(game.ee); | 242 | ecore_evas_free(game.ee); |
233 | #endif | 243 | #endif |