File tree Expand file tree Collapse file tree 5 files changed +76
-3
lines changed Expand file tree Collapse file tree 5 files changed +76
-3
lines changed Original file line number Diff line number Diff line change 1
1
include common.mak
2
2
3
- TESTDIRS := $(patsubst % /,% ,$(dir $(wildcard * /Makefile) ) )
3
+ TESTDIRS := $(sort $( patsubst % /,% ,$(dir $(wildcard * /Makefile) ) ) )
4
4
5
5
help : info
6
6
19
19
done
20
20
21
21
clean :
22
- rm -f * .info * .counts test.log
22
+ rm -rf * .info * .counts test.log src/
23
23
for TEST in $( TESTDIRS) ; do \
24
24
make -C $$ TEST clean ; \
25
25
done
Original file line number Diff line number Diff line change @@ -885,6 +885,11 @@ sub main()
885
885
}
886
886
887
887
if (defined ($opt_output )) {
888
+ if (! -d $opt_output ) {
889
+ mkdir ($opt_output ) or
890
+ die (" $0 : Could not create directory " .
891
+ " $opt_output : $! \n " );
892
+ }
888
893
$root = abs_path($opt_output )
889
894
} else {
890
895
$root = " /" ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ SIZE := small
21
21
CC := gcc
22
22
23
23
export LCOV := lcov $(LCOVFLAGS )
24
+ export GENHTML := genhtml $(LCOVFLAGS )
24
25
export PATH := $(TOPDIR ) /../bin:$(TOPDIR ) /bin:$(PATH )
25
26
export LANG := C
26
27
@@ -40,7 +41,7 @@ clean_common:
40
41
echo " CLEAN $( patsubst %/,%,$( RELDIR) ) "
41
42
42
43
$(INFOFILES ) $(COUNTFILES ) :
43
- cd $(TOPDIR ) && mkinfo profiles/$(SIZE )
44
+ cd $(TOPDIR ) && mkinfo profiles/$(SIZE ) -o src/
44
45
45
46
ifneq ($(V ) ,2)
46
47
.SILENT :
Original file line number Diff line number Diff line change
1
+ include ../common.mak
2
+
3
+ GENHTML_TEST := ./genhtml_test
4
+
5
+ TESTS := genhtml_output_zero genhtml_output_full genhtml_output_target \
6
+ genhtml_output_part1 genhtml_output_part2 genhtml_output_combined
7
+
8
+ test : $(TESTS )
9
+
10
+ genhtml_output_zero :
11
+ @test_run genhtml_output_zero $(GENHTML ) $(ZEROINFO ) -o out_zero/
12
+
13
+ genhtml_output_full :
14
+ @test_run genhtml_output_full $(GENHTML ) $(FULLINFO ) -o out_full/
15
+
16
+ genhtml_output_target :
17
+ @test_run genhtml_output_target $(GENHTML ) $(TARGETINFO ) -o out_target/
18
+
19
+ genhtml_output_part1 :
20
+ @test_run genhtml_output_part1 $(GENHTML ) $(PART1INFO ) -o out_part1/
21
+
22
+ genhtml_output_part2 :
23
+ @test_run genhtml_output_part2 $(GENHTML ) $(PART2INFO ) -o out_part2/
24
+
25
+ genhtml_output_combined : genhtml_output_target
26
+ @test_run genhtml_output_combined $(GENHTML_TEST ) $(TARGETINFO ) $(PART1INFO ) $(PART2INFO )
27
+
28
+ clean :
29
+ rm -rf out_* /
30
+
31
+ .PHONY : test $(TESTS ) clean
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright IBM Corp. 2017
4
+ #
5
+ # Usage: genhtml_test <ref-file> <file1> [<file2>...]
6
+ #
7
+ # Compare genhtml output of a reference coverage data file with that of
8
+ # a combination of multiple files.
9
+ #
10
+
11
+ function die()
12
+ {
13
+ echo " Error: $@ " >&2
14
+ exit 1
15
+ }
16
+
17
+ GENHTMLFLAGS=" -t title"
18
+ REFFILE=$1
19
+ shift
20
+
21
+ if [ -z " $REFFILE " -o -z " $* " ] ; then
22
+ echo " Usage: $0 <ref-file> <file1> [<file2>...]" >&2
23
+ exit 2
24
+ fi
25
+
26
+ OUTREF=" out_$( basename $REFFILE .info) "
27
+ OUTCOMBINED=" out_combined"
28
+
29
+ $GENHTML $GENHTMLFLAGS " $REFFILE " -o " $OUTREF " || \
30
+ die " Could not generate HTML for reference file"
31
+
32
+ $GENHTML $GENHTMLFLAGS " $@ " -o " $OUTCOMBINED " || \
33
+ die " Could not generate HTML for combined files"
34
+
35
+ diff -ur " $OUTREF " " $OUTCOMBINED " -I " headerValue" || \
36
+ die " Mismatch in generated output"
You can’t perform that action at this time.
0 commit comments