diff --git a/tests/core/Sconscript b/tests/core/Sconscript index d331d15f..8ef5fbb6 100644 --- a/tests/core/Sconscript +++ b/tests/core/Sconscript @@ -2,14 +2,15 @@ import os Import("env", "UnitTest") -objs = [] +core_objs = [] def CoreTest(name, source): - global objs + global core_objs if os.path.exists("../../core/%s" % source): - objs += [ env.Object("../../core/%s" % source) ] - run = UnitTest("core/%s" % name, [ source ] + objs) + core_objs += [ env.Object("../../core/%s" % source) ] + run = UnitTest("core/%s" % name, [ source ] + core_objs) Alias("tests/core", run) return run +Export("core_objs") res = [ CoreTest("version", "version.c") ] @@ -19,10 +20,10 @@ res += [ CoreTest("database", "database.cpp") ] res += [ CoreTest("index", "index.cpp") ] res += [ CoreTest("filter", "filter.cpp") ] res += [ CoreTest("idle", "idle.cpp") ] + +res += SConscript("tags/Sconscript") Return("res") -# -#test( "tags/generic" ) #test( "tags/artist" ) #test( "tags/album" ) #test( "tags/genre" ) diff --git a/tests/core/tags/Sconscript b/tests/core/tags/Sconscript new file mode 100644 index 00000000..f3cf8134 --- /dev/null +++ b/tests/core/tags/Sconscript @@ -0,0 +1,15 @@ +#!/usr/bin/python +import os +Import("env", "UnitTest", "core_objs") + +def TagTest(name, source): + global core_objs + if os.path.exists("../../../core/tags/%s" % source): + core_objs += [ env.Object("../../../core/tags/%s" % source) ] + run = UnitTest("core/tags/%s" % name, [ source ] + core_objs) + Alias("tests/core", run) + Alias("tests/core/tags", run) + return run + +res = [ TagTest("generic", "generic.cpp") ] +Return("res") diff --git a/tests/core/tags/generic.cpp b/tests/core/tags/generic.cpp index 35a1e1f3..a35a4824 100644 --- a/tests/core/tags/generic.cpp +++ b/tests/core/tags/generic.cpp @@ -2,7 +2,7 @@ * Copyright 2014 (c) Anna Schumaker. */ #include -#include +#include "../test.h" static void test_generic_tag() { @@ -49,9 +49,7 @@ static void test_generic_tag_comparison() test_equal(A.compare(&empty), -1); } -int main(int argc, char **argv) -{ - test :: run("Generic Tag Test", test_generic_tag); - test :: run("Generic Tag Compare Test", test_generic_tag_comparison); - return 0; -} +DECLARE_UNIT_TESTS( + UNIT_TEST("Generic Tag", test_generic_tag), + UNIT_TEST("Generic Tag Comparison", test_generic_tag_comparison), +);