tests/core: Update version test to the new framework
The version test is fairly simple, since it only tests the values set in a single header file. The remaining tests will be more challenging, since I'll have to modify core code and the test at the same time. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
63769c9c0b
commit
55a7673983
|
@ -26,8 +26,7 @@ def UnitTest(test, sources):
|
|||
return run
|
||||
Export("UnitTest")
|
||||
|
||||
res = []
|
||||
#res = SConscript("core/Sconscript")
|
||||
res = SConscript("core/Sconscript")
|
||||
if check_sanity == True:
|
||||
res = [ UnitTest("sanity", [ "sanity.c" ]) ] + res
|
||||
for t in res[1:]:
|
||||
|
|
|
@ -1,33 +1,39 @@
|
|||
#!/usr/bin/python
|
||||
Import("test_env", "generic_test", "get_test_obj")
|
||||
import os
|
||||
Import("UnitTest")
|
||||
|
||||
objs = []
|
||||
def test(name):
|
||||
global objs
|
||||
objs = generic_test(name, "core", objs, [])
|
||||
def CoreTest(name, source):
|
||||
src_list = [ source ]
|
||||
if os.path.exists("../../core/%s" % source):
|
||||
src_list += [ "../../core/%s" % source ]
|
||||
run = UnitTest("core/%s" % name, src_list)
|
||||
Alias("tests/core", run)
|
||||
return run
|
||||
|
||||
|
||||
test( "version" )
|
||||
test( "string" )
|
||||
test( "file" )
|
||||
test( "database" )
|
||||
test( "index" )
|
||||
test( "filter" )
|
||||
test( "idle" )
|
||||
res = [ CoreTest("version", "version.c") ]
|
||||
Return("res")
|
||||
|
||||
test( "tags/generic" )
|
||||
test( "tags/artist" )
|
||||
test( "tags/album" )
|
||||
test( "tags/genre" )
|
||||
test( "tags/library" )
|
||||
test( "tags/track" )
|
||||
|
||||
test( "random" )
|
||||
|
||||
objs += [ get_test_obj("tags/tags", "core") ]
|
||||
test( "queue" )
|
||||
test_env.UsePackage("taglib")
|
||||
test( "library" )
|
||||
test( "playlist" )
|
||||
test( "deck" )
|
||||
test( "audio" )
|
||||
#test( "string", )
|
||||
#test( "file" )
|
||||
#test( "database" )
|
||||
#test( "index" )
|
||||
#test( "filter" )
|
||||
#test( "idle" )
|
||||
#
|
||||
#test( "tags/generic" )
|
||||
#test( "tags/artist" )
|
||||
#test( "tags/album" )
|
||||
#test( "tags/genre" )
|
||||
#test( "tags/library" )
|
||||
#test( "tags/track" )
|
||||
#
|
||||
#test( "random" )
|
||||
#
|
||||
#objs += [ get_test_obj("tags/tags", "core") ]
|
||||
#test( "queue" )
|
||||
#test_env.UsePackage("taglib")
|
||||
#test( "library" )
|
||||
#test( "playlist" )
|
||||
#test( "deck" )
|
||||
#test( "audio" )
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* Copyright 2013 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <core/version.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
static void test_version()
|
||||
{
|
||||
test_equal(get_version(), CONFIG_VERSION);
|
||||
}
|
||||
|
||||
DECLARE_UNIT_TESTS(
|
||||
UNIT_TEST("Version", test_version),
|
||||
);
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright 2013 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <core/version.h>
|
||||
#include <tests/test.h>
|
||||
|
||||
static void test_version()
|
||||
{
|
||||
test_equal((std::string)get_version(), CONFIG_VERSION);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
test :: run("Version Test", test_version);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue