Skip to content

Commit 6ab1fb9

Browse files
committed
refactor, add fragment for coverage in preparation for tests
1 parent 2ae86bf commit 6ab1fb9

22 files changed

+42
-11
lines changed

Makefile.frag

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
stat-test-coverage:
2+
CCACHE_DISABLE=1 EXTRA_CFLAGS="-fprofile-arcs -ftest-coverage" TEST_PHP_ARGS="-q" $(MAKE) clean test
3+
4+
stat-test-coverage-lcov: stat-test-coverage
5+
lcov -c --directory $(top_srcdir)/src/.libs --output-file $(top_srcdir)/coverage.info
6+
7+
stat-test-coverage-html: stat-test-coverage-lcov
8+
genhtml $(top_srcdir)/coverage.info --output-directory=$(top_srcdir)/html
9+
10+
stat-test-coverage-travis:
11+
CCACHE_DISABLE=1 EXTRA_CFLAGS="-fprofile-arcs -ftest-coverage" $(MAKE)

config.m4

+31-11
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,44 @@ PHP_ARG_ENABLE([stat],
66
[Enable stat support])],
77
[no])
88

9+
PHP_ARG_ENABLE([stat-coverage],
10+
[whether to enable stat coverage support],
11+
[AS_HELP_STRING([--enable-stat-coverage],
12+
[Enable stat coverage support])],
13+
[no], [no])
14+
915
if test "$PHP_STAT" != "no"; then
1016
PHP_ADD_LIBRARY(pthread,, STAT_SHARED_LIBADD)
1117

1218
AC_DEFINE(HAVE_ZEND_STAT, 1, [ Have stat support ])
1319

14-
PHP_NEW_EXTENSION(stat,
20+
PHP_NEW_EXTENSION(stat,
1521
zend_stat.c \
16-
zend_stat_arena.c \
17-
zend_stat_buffer.c \
18-
zend_stat_ini.c \
19-
zend_stat_io.c \
20-
zend_stat_request.c \
21-
zend_stat_stream.c \
22-
zend_stat_control.c \
23-
zend_stat_sampler.c \
24-
zend_stat_sample.c \
25-
zend_stat_strings.c,
22+
src/zend_stat_arena.c \
23+
src/zend_stat_buffer.c \
24+
src/zend_stat_ini.c \
25+
src/zend_stat_io.c \
26+
src/zend_stat_request.c \
27+
src/zend_stat_stream.c \
28+
src/zend_stat_control.c \
29+
src/zend_stat_sampler.c \
30+
src/zend_stat_sample.c \
31+
src/zend_stat_strings.c,
2632
$ext_shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
2733

34+
PHP_ADD_BUILD_DIR($ext_builddir/src, 1)
35+
PHP_ADD_INCLUDE($ext_srcdir/src)
36+
PHP_ADD_INCLUDE($ext_srcdir)
37+
38+
AC_MSG_CHECKING([stat coverage])
39+
if test "$PHP_STAT_COVERAGE" != "no"; then
40+
AC_MSG_RESULT([enabled])
41+
42+
PHP_ADD_MAKEFILE_FRAGMENT
43+
else
44+
AC_MSG_RESULT([disabled])
45+
fi
46+
47+
2848
PHP_SUBST(STAT_SHARED_LIBADD)
2949
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)