Browse Source

generate code coverage reports

master
Martin Dørum 3 years ago
parent
commit
56008fc9f4

+ 3
- 1
test/build.bx View File

@@ -2,4 +2,6 @@ files := src ../lib
includes := snow ../include/lang2
defines := SNOW_ENABLED
sanitizers := address undefined
cflags := -g
cflags := -g -fprofile-arcs -ftest-coverage
ldflags := --coverage
ldlibs := gcov

+ 2
- 0
test/examples/arrays.l2 View File

@@ -4,3 +4,5 @@ print arr.2

arr.1 = "nope"
print arr

print []

+ 1
- 0
test/examples/arrays.l2.expected View File

@@ -1,3 +1,4 @@
[10 20 30]
30
[10 nope 30]
[]

+ 2
- 0
test/examples/functions.l2 View File

@@ -24,3 +24,5 @@ func := {
{retval}
}
print func()()

print {0}

+ 1
- 0
test/examples/functions.l2.expected View File

@@ -2,3 +2,4 @@ hello
Hello World
10
what's up
(function)

+ 2
- 0
test/examples/namespaces.l2 View File

@@ -8,3 +8,5 @@ print obj.foo

obj.bar = {baz: "how's your day going?"}
print obj.bar.baz

print {}

+ 1
- 0
test/examples/namespaces.l2.expected View File

@@ -1,3 +1,4 @@
hello world
100
how's your day going?
(namespace)

+ 12
- 0
test/generate-coverage.sh View File

@@ -0,0 +1,12 @@
#!/bin/sh
set -ex

box --run -q
mkdir -p coverage
gcov $(find bx-out -type f -name '*.o')
mv *.gcov coverage
cp $(find bx-out -type f -name '*.gcda' -or -name '*.gcno') coverage

cd coverage
lcov --capture --directory . --output-file coverage.info
genhtml coverage.info --output-directory report

+ 1
- 0
test/src/examples.t.c View File

@@ -111,6 +111,7 @@ static void check_impl(const char *name) {
vm.std_output = &output.w;

l2_vm_run(&vm);
l2_vm_gc(&vm);

l2_vm_free(&vm);
free(bytecode.mem);

Loading…
Cancel
Save