summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/elementary/.gitignore3
-rw-r--r--legacy/elementary/Makefile.am34
-rw-r--r--legacy/elementary/configure.ac50
-rw-r--r--legacy/elementary/src/Makefile.am2
-rw-r--r--legacy/elementary/src/bin/Makefile.am8
5 files changed, 88 insertions, 9 deletions
diff --git a/legacy/elementary/.gitignore b/legacy/elementary/.gitignore
index 4c0b0c75c1..5427997d4e 100644
--- a/legacy/elementary/.gitignore
+++ b/legacy/elementary/.gitignore
@@ -11,6 +11,8 @@
11*.lo 11*.lo
12*.o 12*.o
13*.la 13*.la
14*.gcda
15*.gcno
14.libs 16.libs
15.deps 17.deps
16.*.swp 18.*.swp
@@ -57,3 +59,4 @@ tags
57/config/mobile/*.src 59/config/mobile/*.src
58/config/standard/*.src 60/config/standard/*.src
59Session.vim 61Session.vim
62/coverage/
diff --git a/legacy/elementary/Makefile.am b/legacy/elementary/Makefile.am
index 70f7a92faa..30de680d10 100644
--- a/legacy/elementary/Makefile.am
+++ b/legacy/elementary/Makefile.am
@@ -54,9 +54,6 @@ po/Rules-quot
54 54
55endif 55endif
56 56
57
58
59
60EXTRA_DIST = \ 57EXTRA_DIST = \
61README \ 58README \
62AUTHORS \ 59AUTHORS \
@@ -125,3 +122,34 @@ doc:
125screenshots: all 122screenshots: all
126 @echo "entering src/examples/" 123 @echo "entering src/examples/"
127 $(MAKE) -C src/examples screenshots 124 $(MAKE) -C src/examples screenshots
125
126if ELEMENTARY_ENABLE_COVERAGE
127
128lcov-reset:
129 @rm -rf $(top_builddir)/coverage
130 @find $(top_builddir) -name "*.gcda" -delete
131 @lcov --zerocounters --directory $(top_builddir)
132
133lcov-report:
134 @mkdir $(top_builddir)/coverage
135 lcov --capture --compat-libtool --no-external --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir) --base-directory $(top_srcdir)/src/lib/
136 lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info
137 lcov --remove $(top_builddir)/coverage/coverage.cleaned.info '*/elm_test_*' --output-file $(top_builddir)/coverage/coverage.cleaned2.info
138 lcov --remove $(top_builddir)/coverage/coverage.cleaned2.info '*/elm_suite.c' --output-file $(top_builddir)/coverage/coverage.cleaned3.info
139 lcov --remove $(top_builddir)/coverage/coverage.cleaned3.info '*NONE*' --output-file $(top_builddir)/coverage/coverage.cleaned4.info
140 genhtml --branch-coverage -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned4.info
141 @echo "Coverage Report at $(top_builddir)/coverage/html"
142
143endif
144
145if ELEMENTARY_ENABLE_TESTS
146
147lcov-check:
148if ELEMENTARY_ENABLE_COVERAGE
149 @$(MAKE) $(AM_MAKEFLAGS) lcov-reset
150endif
151 @$(MAKE) $(AM_MAKEFLAGS) check
152if ELEMENTARY_ENABLE_COVERAGE
153 @$(MAKE) $(AM_MAKEFLAGS) lcov-report
154endif
155endif
diff --git a/legacy/elementary/configure.ac b/legacy/elementary/configure.ac
index 5804d6b7a1..5b075e8708 100644
--- a/legacy/elementary/configure.ac
+++ b/legacy/elementary/configure.ac
@@ -39,10 +39,32 @@ AC_ARG_ENABLE([cxx-bindings],
39# Tests 39# Tests
40 40
41AC_ARG_WITH([tests], 41AC_ARG_WITH([tests],
42 [AS_HELP_STRING([--with-tests=none|regular], 42 [AS_HELP_STRING([--with-tests=none|regular|coverate],
43 [choose elementary testing method: regular or none.(coverage will be supported)@<:@default=none@:>@])], 43 [choose elementary testing method: regular, coverage or none @<:@default=none@:>@])],
44 [build_tests=${withval}], 44 [build_tests=${withval}],
45 [build_tests=none]) 45 [build_tests=auto])
46
47want_coverage="no"
48want_tests="no"
49case "${build_tests}" in
50 auto)
51 if test "${build_profile}" = "dev"; then
52 want_tests="yes"
53 fi
54 ;;
55 regular)
56 want_tests="yes"
57 ;;
58 coverage)
59 want_tests="yes"
60 want_coverage="yes"
61 ;;
62 no*)
63 ;;
64 *)
65 AC_MSG_ERROR([Unknown build tests option: --with-tests=${build_tests}])
66 ;;
67esac
46 68
47# Elementary base dir 69# Elementary base dir
48 70
@@ -336,10 +358,28 @@ ELEMENTARY_PC_LIBS="${ELEMENTARY_PC_LIBS} ${requirement_elm_libs}"
336AC_SUBST([requirement_elm_pc]) 358AC_SUBST([requirement_elm_pc])
337 359
338# check unit testing library 360# check unit testing library
339if test "${build_tests}" = "regular"; then 361if test "${want_tests}" = "yes"; then
340 PKG_CHECK_MODULES([CHECK], [check >= 0.9.5]) 362 PKG_CHECK_MODULES([CHECK], [check >= 0.9.5])
341fi 363fi
342AM_CONDITIONAL([ENABLE_ELEMENTARY_TESTS], [test "${build_tests}" = "regular"]) 364AM_CONDITIONAL([ELEMENTARY_ENABLE_TESTS], [test "${want_tests}" = "yes"])
365
366# lcov
367if test "${want_coverage}" = "yes" ; then
368 AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
369 if test "x${have_lcov}" = "xyes" ; then
370 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -fprofile-arcs -ftest-coverage"
371 ELEMENTARY_LIBS="${ELEMENTARY_LIBS} -lgcov"
372 if test "x${prefer_assert}" = "xno"; then
373 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -DNDEBUG"
374 else
375 ELEMENTARY_CFLAGS="${ELEMENTARY_CFLAGS} -g -O0 -DDEBUG"
376 fi
377 else
378 AC_MSG_ERROR([lcov is not found])
379 fi
380fi
381
382AM_CONDITIONAL([ELEMENTARY_ENABLE_COVERAGE], [test "${want_coverage}" = "yes"])
343 383
344 384
345### Checks for header files 385### Checks for header files
diff --git a/legacy/elementary/src/Makefile.am b/legacy/elementary/src/Makefile.am
index 7f9e3c36ef..bc0e30f015 100644
--- a/legacy/elementary/src/Makefile.am
+++ b/legacy/elementary/src/Makefile.am
@@ -9,6 +9,6 @@ endif
9 9
10SUBDIRS += examples 10SUBDIRS += examples
11 11
12if ENABLE_ELEMENTARY_TESTS 12if ELEMENTARY_ENABLE_TESTS
13SUBDIRS += tests 13SUBDIRS += tests
14endif 14endif
diff --git a/legacy/elementary/src/bin/Makefile.am b/legacy/elementary/src/bin/Makefile.am
index 8c438dacae..05faaf476c 100644
--- a/legacy/elementary/src/bin/Makefile.am
+++ b/legacy/elementary/src/bin/Makefile.am
@@ -171,6 +171,14 @@ elementary_quicklaunch_LDADD = $(top_builddir)/src/lib/libelementary.la \
171elementary_quicklaunch_LDFLAGS = 171elementary_quicklaunch_LDFLAGS =
172 172
173if BUILD_RUN 173if BUILD_RUN
174elementary_run_CPPFLAGS = -I$(top_srcdir) \
175-I$(top_srcdir)/src/lib \
176-I$(top_builddir)/src/lib \
177-I$(top_srcdir)/src/bin \
178-DPACKAGE_BIN_DIR=\"$(bindir)\" \
179-DPACKAGE_LIB_DIR=\"$(libdir)\" \
180-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\"
181
174elementary_run_SOURCES = run.c 182elementary_run_SOURCES = run.c
175elementary_run_LDADD = 183elementary_run_LDADD =
176elementary_run_LDFLAGS = 184elementary_run_LDFLAGS =