summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-07 21:27:39 +0000
committerDavid Robillard <d@drobilla.net>2010-01-07 21:27:39 +0000
commit936348fd730f2d3ebc5376b555f0cfc1e633c019 (patch)
tree007c54a11246877df07e00f11559380282826ccf /test
parent5e4654826a1b726a8b2fc88520975311a2553d71 (diff)
downloadlilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.tar.gz
lilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.tar.bz2
lilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.zip
Move unit testing and coverage framework into autowaf.
Make raul tests return 0 on success, 1 on failure. Test coverage for Raul. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2368 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test')
-rw-r--r--test/slv2_test.c4
-rwxr-xr-xtest/test_coverage.sh16
-rw-r--r--test/wscript18
3 files changed, 2 insertions, 36 deletions
diff --git a/test/slv2_test.c b/test/slv2_test.c
index 842f3bb..0ee3caf 100644
--- a/test/slv2_test.c
+++ b/test/slv2_test.c
@@ -996,7 +996,7 @@ run_tests()
{
int i;
for (i = 0; tests[i].title; i++) {
- printf("--- Test: %s\n", tests[i].title);
+ printf("*** Test %s\n", tests[i].title);
if (!tests[i].func()) {
printf("\nTest failed\n");
/* test case that wasn't able to be executed at all counts as 1 test + 1 error */
@@ -1018,7 +1018,7 @@ main(int argc, char *argv[])
init_tests();
run_tests();
cleanup();
- printf("\n***\n*** Test Results: %d tests, %d errors\n***\n\n", test_count, error_count);
+ printf("\n*** Test Results: %d tests, %d errors\n\n", test_count, error_count);
return error_count ? 1 : 0;
}
diff --git a/test/test_coverage.sh b/test/test_coverage.sh
deleted file mode 100755
index 045f136..0000000
--- a/test/test_coverage.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# Run this script (from the directory it's in) after building
-# (with waf configure --debug --test) to run the
-# unit tests and generate a code coverage report
-
-cd ../build/default
-
-lcov -d ./src -z
-./test/slv2_test
-lcov -d ./src -d ./test -b .. -c > coverage.lcov
-mkdir -p ./coverage
-genhtml -o coverage coverage.lcov
-echo "Report written to:"
-echo "../build/default/coverage/index.html"
-
diff --git a/test/wscript b/test/wscript
deleted file mode 100644
index 11f5b33..0000000
--- a/test/wscript
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-
-def build(bld):
- tests = '''
- slv2_test
- '''
- if bld.env['BUILD_TESTS']:
- for i in tests.split():
- obj = bld.new_task_gen('cc', 'program')
- obj.source = i + '.c'
- obj.includes = '..'
- obj.uselib_local = 'libslv2_static'
- obj.uselib = 'REDLAND LV2CORE'
- obj.libs = 'gcov'
- obj.target = i
- obj.install_path = ''
- obj.ccflags = [ '-fprofile-arcs', '-ftest-coverage' ]
-