tests: Began creating test programs
I want these to help check for memory leaks and other problems. Maybe one day I can run them through Jenkins! Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
9e322433d5
commit
5d687176e8
|
@ -4,3 +4,4 @@
|
||||||
.sconsign.dblite
|
.sconsign.dblite
|
||||||
ocarina.bin
|
ocarina.bin
|
||||||
include/version.h
|
include/version.h
|
||||||
|
test_*
|
||||||
|
|
16
Sconstruct
16
Sconstruct
|
@ -48,9 +48,21 @@ def list_dirs(directory):
|
||||||
|
|
||||||
# Note: a version.h file is not created in this directory,
|
# Note: a version.h file is not created in this directory,
|
||||||
# so the command will always run.
|
# so the command will always run.
|
||||||
Default( env.Command("version.h", None, version_h) )
|
version_h=env.Command("version.h", None, version_h)
|
||||||
ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
|
ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
|
||||||
Default(ocarina)
|
Default([version_h, ocarina])
|
||||||
|
|
||||||
|
tests=os.listdir("tests/")
|
||||||
|
test_list = []
|
||||||
|
for test in tests:
|
||||||
|
if test[0] == ".":
|
||||||
|
continue;
|
||||||
|
split = test.rsplit(".", 1);
|
||||||
|
src = "tests/" + test
|
||||||
|
dst = "test_" + split[0]
|
||||||
|
test_list.append(env.Program(dst, list_dirs('libsaria') + [src]))
|
||||||
|
|
||||||
|
env.Alias("tests", [version_h] + [test_list]);
|
||||||
|
|
||||||
# Install Ocarina
|
# Install Ocarina
|
||||||
scripts = os.listdir("scripts/")
|
scripts = os.listdir("scripts/")
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include <libsaria/libsaria.h>
|
||||||
|
|
||||||
|
int main (int argc, char **argv)
|
||||||
|
{
|
||||||
|
libsaria::init(argc, argv);
|
||||||
|
while (libsaria::idle::run_task() != 0);
|
||||||
|
libsaria::quit();
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue