Browse Source

generate code coverage reports

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

+ 3
- 1
test/build.bx View File

includes := snow ../include/lang2 includes := snow ../include/lang2
defines := SNOW_ENABLED defines := SNOW_ENABLED
sanitizers := address undefined sanitizers := address undefined
cflags := -g
cflags := -g -fprofile-arcs -ftest-coverage
ldflags := --coverage
ldlibs := gcov

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



arr.1 = "nope" arr.1 = "nope"
print arr print arr

print []

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

[10 20 30] [10 20 30]
30 30
[10 nope 30] [10 nope 30]
[]

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

{retval} {retval}
} }
print func()() print func()()

print {0}

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

Hello World Hello World
10 10
what's up what's up
(function)

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



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

print {}

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

hello world hello world
100 100
how's your day going? how's your day going?
(namespace)

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

#!/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

vm.std_output = &output.w; vm.std_output = &output.w;


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


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

Loading…
Cancel
Save