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:
Bryan Schumaker 2012-02-09 08:21:46 -05:00
parent 9e322433d5
commit 5d687176e8
3 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
.sconsign.dblite
ocarina.bin
include/version.h
test_*

View File

@ -48,9 +48,21 @@ def list_dirs(directory):
# Note: a version.h file is not created in this directory,
# 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'))
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
scripts = os.listdir("scripts/")

9
tests/libsaria.cpp Normal file
View File

@ -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;
}