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
|
return run
|
||||||
Export("UnitTest")
|
Export("UnitTest")
|
||||||
|
|
||||||
res = []
|
res = SConscript("core/Sconscript")
|
||||||
#res = SConscript("core/Sconscript")
|
|
||||||
if check_sanity == True:
|
if check_sanity == True:
|
||||||
res = [ UnitTest("sanity", [ "sanity.c" ]) ] + res
|
res = [ UnitTest("sanity", [ "sanity.c" ]) ] + res
|
||||||
for t in res[1:]:
|
for t in res[1:]:
|
||||||
|
|
|
@ -1,33 +1,39 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
Import("test_env", "generic_test", "get_test_obj")
|
import os
|
||||||
|
Import("UnitTest")
|
||||||
|
|
||||||
objs = []
|
def CoreTest(name, source):
|
||||||
def test(name):
|
src_list = [ source ]
|
||||||
global objs
|
if os.path.exists("../../core/%s" % source):
|
||||||
objs = generic_test(name, "core", objs, [])
|
src_list += [ "../../core/%s" % source ]
|
||||||
|
run = UnitTest("core/%s" % name, src_list)
|
||||||
|
Alias("tests/core", run)
|
||||||
|
return run
|
||||||
|
|
||||||
|
|
||||||
test( "version" )
|
res = [ CoreTest("version", "version.c") ]
|
||||||
test( "string" )
|
Return("res")
|
||||||
test( "file" )
|
|
||||||
test( "database" )
|
|
||||||
test( "index" )
|
|
||||||
test( "filter" )
|
|
||||||
test( "idle" )
|
|
||||||
|
|
||||||
test( "tags/generic" )
|
#test( "string", )
|
||||||
test( "tags/artist" )
|
#test( "file" )
|
||||||
test( "tags/album" )
|
#test( "database" )
|
||||||
test( "tags/genre" )
|
#test( "index" )
|
||||||
test( "tags/library" )
|
#test( "filter" )
|
||||||
test( "tags/track" )
|
#test( "idle" )
|
||||||
|
#
|
||||||
test( "random" )
|
#test( "tags/generic" )
|
||||||
|
#test( "tags/artist" )
|
||||||
objs += [ get_test_obj("tags/tags", "core") ]
|
#test( "tags/album" )
|
||||||
test( "queue" )
|
#test( "tags/genre" )
|
||||||
test_env.UsePackage("taglib")
|
#test( "tags/library" )
|
||||||
test( "library" )
|
#test( "tags/track" )
|
||||||
test( "playlist" )
|
#
|
||||||
test( "deck" )
|
#test( "random" )
|
||||||
test( "audio" )
|
#
|
||||||
|
#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