parent
681749300e
commit
662871b057
|
@ -18,6 +18,11 @@ missing \
|
||||||
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
|
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
|
||||||
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
|
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
|
||||||
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
|
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
|
||||||
|
m4/efl_binary.m4 \
|
||||||
|
m4/efl_coverage.m4 \
|
||||||
|
m4/efl_doxygen.m4 \
|
||||||
|
m4/efl_path_max.m4 \
|
||||||
|
m4/efl_tests.m4 \
|
||||||
m4/libtool.m4 \
|
m4/libtool.m4 \
|
||||||
m4/lt~obsolete.m4 \
|
m4/lt~obsolete.m4 \
|
||||||
m4/ltoptions.m4 \
|
m4/ltoptions.m4 \
|
||||||
|
@ -46,10 +51,56 @@ README
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = edje.pc
|
pkgconfig_DATA = edje.pc
|
||||||
|
|
||||||
.PHONY: doc
|
.PHONY: doc coverage
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
@echo "entering doc/"
|
@echo "entering doc/"
|
||||||
make -C doc doc
|
make -C doc doc
|
||||||
|
|
||||||
|
# Unit tests
|
||||||
|
|
||||||
|
if EFL_ENABLE_TESTS
|
||||||
|
|
||||||
|
check-local:
|
||||||
|
@./src/tests/edje_suite
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
check-local:
|
||||||
|
@echo "reconfigure with --enable-tests"
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Coverage report
|
||||||
|
|
||||||
|
if EFL_ENABLE_COVERAGE
|
||||||
|
lcov-reset:
|
||||||
|
@rm -rf coverage
|
||||||
|
@find . -name "*.gcda" -exec rm {} \;
|
||||||
|
@lcov --directory . --zerocounters
|
||||||
|
|
||||||
|
lcov-report:
|
||||||
|
@mkdir coverage
|
||||||
|
@lcov --compat-libtool --directory $(top_srcdir)/src --capture --output-file coverage/coverage.info
|
||||||
|
@lcov -l coverage/coverage.info |grep "\\.h" |cut -d " " -f 2 > coverage/remove
|
||||||
|
@lcov -r coverage/coverage.info `cat coverage/remove` > coverage/coverage.cleaned.info
|
||||||
|
@rm coverage/remove
|
||||||
|
@mv coverage/coverage.cleaned.info coverage/coverage.info
|
||||||
|
@genhtml -t "$(PACKAGE_STRING)" -o coverage coverage/coverage.info
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
@make lcov-reset
|
||||||
|
@make check
|
||||||
|
@make lcov-report
|
||||||
|
else
|
||||||
|
lcov-reset:
|
||||||
|
@echo "reconfigure with --enable-coverage"
|
||||||
|
|
||||||
|
lcov-report:
|
||||||
|
@echo "reconfigure with --enable-coverage"
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
@echo "reconfigure with --enable-tests --enable-coverage"
|
||||||
|
endif
|
||||||
|
|
|
@ -371,6 +371,17 @@ case "$host_os" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
### Unit tests, coverage and benchmarking
|
||||||
|
|
||||||
|
EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
|
||||||
|
|
||||||
|
EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
|
||||||
|
EDJE_CFLAGS="${EDJE_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
|
||||||
|
EDJE_LIBS="${EDJE_LIBS} ${EFL_COVERAGE_LIBS}"
|
||||||
|
if test "x$enable_coverage" = "xyes" ; then
|
||||||
|
EDJE_CFLAGS="${EDJE_CFLAGS} ${EFL_DEBUG_CFLAGS}"
|
||||||
|
fi
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
install_examples="yes"
|
install_examples="yes"
|
||||||
|
@ -421,6 +432,7 @@ src/Makefile
|
||||||
src/lib/Makefile
|
src/lib/Makefile
|
||||||
src/bin/Makefile
|
src/bin/Makefile
|
||||||
src/bin/epp/Makefile
|
src/bin/epp/Makefile
|
||||||
|
src/tests/Makefile
|
||||||
utils/Makefile
|
utils/Makefile
|
||||||
src/examples/Makefile
|
src/examples/Makefile
|
||||||
])
|
])
|
||||||
|
@ -444,6 +456,8 @@ echo " EDJE_PROGRAM_CACHE...: $want_edje_program_cache"
|
||||||
echo " EDJE_CALC_CACHE......: $want_edje_calc_cache"
|
echo " EDJE_CALC_CACHE......: $want_edje_calc_cache"
|
||||||
echo " Fixed point..........: $want_fixed_point"
|
echo " Fixed point..........: $want_fixed_point"
|
||||||
echo " Documentation........: ${build_doc}"
|
echo " Documentation........: ${build_doc}"
|
||||||
|
echo " Tests................: ${enable_tests}"
|
||||||
|
echo " Coverage.............: ${enable_coverage}"
|
||||||
echo " Examples.............: install:${install_examples} build:${build_examples}"
|
echo " Examples.............: install:${install_examples} build:${build_examples}"
|
||||||
echo
|
echo
|
||||||
echo "Programs:"
|
echo "Programs:"
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
|
||||||
|
dnl That code is public domain and can be freely used or copied.
|
||||||
|
|
||||||
|
dnl Macro that check if coverage support is wanted and, if yes, if
|
||||||
|
dnl lcov is available.
|
||||||
|
|
||||||
|
dnl Usage: EFL_CHECK_COVERAGE(tests [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||||
|
dnl The parameter 'tests' is used if a dependency is needed. If set to "yes",
|
||||||
|
dnl the dependency is available.
|
||||||
|
dnl Defines EFL_COVERAGE_CFLAGS and EFL_COVERAGE_LIBS variables
|
||||||
|
dnl Defines the automake conditionnal EFL_ENABLE_COVERAGE
|
||||||
|
|
||||||
|
AC_DEFUN([EFL_CHECK_COVERAGE],
|
||||||
|
[
|
||||||
|
|
||||||
|
dnl configure option
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([coverage],
|
||||||
|
[AC_HELP_STRING([--enable-coverage], [enable coverage profiling instrumentation @<:@default=disabled@:>@])],
|
||||||
|
[
|
||||||
|
if test "x${enableval}" = "xyes" ; then
|
||||||
|
_efl_enable_coverage="yes"
|
||||||
|
else
|
||||||
|
_efl_enable_coverage="no"
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[_efl_enable_coverage="no"])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to use profiling instrumentation])
|
||||||
|
AC_MSG_RESULT([$_efl_enable_coverage])
|
||||||
|
|
||||||
|
dnl lcov check
|
||||||
|
|
||||||
|
if test "x$_efl_enable_coverage" = "xyes" && test ! "x$1" = "xyes" ; then
|
||||||
|
AC_MSG_WARN([Coverage report requested but tests not being built, disable profiling instrumentation.])
|
||||||
|
AC_MSG_WARN([Run configure with --enable-tests])
|
||||||
|
_efl_enable_coverage="no"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$_efl_enable_coverage" = "xyes" ; then
|
||||||
|
AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
|
||||||
|
if test "x$have_lcov" = "xyes" ; then
|
||||||
|
EFL_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
|
||||||
|
EFL_COVERAGE_LIBS="-lgcov"
|
||||||
|
# remove any optimisation flag and force debug symbols
|
||||||
|
EFL_DEBUG_CFLAGS="-g -O0 -DDEBUG"
|
||||||
|
else
|
||||||
|
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
|
||||||
|
_efl_enable_coverage="no"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl Substitution
|
||||||
|
AC_SUBST(EFL_COVERAGE_CFLAGS)
|
||||||
|
AC_SUBST(EFL_COVERAGE_LIBS)
|
||||||
|
|
||||||
|
AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_efl_enable_coverage}" = "xyes")
|
||||||
|
|
||||||
|
AS_IF([test "x$_efl_enable_coverage" = "xyes"], [$2], [$3])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl End of efl_coverage.m4
|
|
@ -0,0 +1,43 @@
|
||||||
|
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
|
||||||
|
dnl That code is public domain and can be freely used or copied.
|
||||||
|
|
||||||
|
dnl Macro that check if tests programs are wanted and if yes, if
|
||||||
|
dnl the Check library is available.
|
||||||
|
|
||||||
|
dnl Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||||
|
dnl Define the automake conditionnal EFL_ENABLE_TESTS
|
||||||
|
|
||||||
|
AC_DEFUN([EFL_CHECK_TESTS],
|
||||||
|
[
|
||||||
|
|
||||||
|
dnl configure option
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([tests],
|
||||||
|
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=disabled@:>@])],
|
||||||
|
[
|
||||||
|
if test "x${enableval}" = "xyes" ; then
|
||||||
|
_efl_enable_tests="yes"
|
||||||
|
else
|
||||||
|
_efl_enable_tests="no"
|
||||||
|
fi
|
||||||
|
],
|
||||||
|
[_efl_enable_tests="no"])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether tests are built])
|
||||||
|
AC_MSG_RESULT([${_efl_enable_tests}])
|
||||||
|
|
||||||
|
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||||
|
|
||||||
|
if test "x${_efl_enable_tests}" = "xyes" ; then
|
||||||
|
PKG_CHECK_MODULES([CHECK],
|
||||||
|
[check >= 0.9.5],
|
||||||
|
[dummy="yes"],
|
||||||
|
[_efl_enable_tests="no"])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes")
|
||||||
|
|
||||||
|
AS_IF([test "x$_efl_enable_tests" = "xyes"], [$1], [$2])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl End of efl_tests.m4
|
|
@ -1,4 +1,4 @@
|
||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
SUBDIRS = lib bin examples
|
SUBDIRS = lib bin tests examples
|
||||||
MAINTAINERCLEANFILES = Makefile.in
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
|
@ -133,4 +133,4 @@ libedje_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @versio
|
||||||
EXTRA_DIST = edje_private.h edje_container.h edje_convert.h
|
EXTRA_DIST = edje_private.h edje_container.h edje_convert.h
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
@rm -rf edje_amalgamation.c
|
@rm -rf *.gcno edje_amalgamation.c
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in
|
||||||
|
|
||||||
|
AM_CPPFLAGS = \
|
||||||
|
-I$(top_srcdir)/src/lib \
|
||||||
|
@EDJE_CFLAGS@ \
|
||||||
|
@CHECK_CFLAGS@
|
||||||
|
|
||||||
|
if EFL_ENABLE_TESTS
|
||||||
|
|
||||||
|
noinst_PROGRAMS = edje_suite
|
||||||
|
|
||||||
|
check_PROGRAMS = edje_suite
|
||||||
|
|
||||||
|
edje_suite_SOURCES = \
|
||||||
|
edje_suite.c \
|
||||||
|
edje_test_edje.c \
|
||||||
|
edje_suite.h
|
||||||
|
|
||||||
|
edje_suite_LDADD = \
|
||||||
|
@EDJE_LIBS@ \
|
||||||
|
@CHECK_LIBS@ \
|
||||||
|
$(top_builddir)/src/lib/libedje.la
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
rm -rf *.gcno *.gcda
|
|
@ -0,0 +1,101 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Edje.h>
|
||||||
|
|
||||||
|
#include "edje_suite.h"
|
||||||
|
|
||||||
|
typedef struct _Edje_Test_Case Edje_Test_Case;
|
||||||
|
|
||||||
|
struct _Edje_Test_Case
|
||||||
|
{
|
||||||
|
const char *test_case;
|
||||||
|
void (*build)(TCase *tc);
|
||||||
|
};
|
||||||
|
|
||||||
|
static const Edje_Test_Case etc[] = {
|
||||||
|
{ "Edje", edje_test_edje },
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
_list_tests(void)
|
||||||
|
{
|
||||||
|
const Edje_Test_Case *itr;
|
||||||
|
|
||||||
|
itr = etc;
|
||||||
|
fputs("Available Test Cases:\n", stderr);
|
||||||
|
for (; itr->test_case; itr++)
|
||||||
|
fprintf(stderr, "\t%s\n", itr->test_case);
|
||||||
|
}
|
||||||
|
static Eina_Bool
|
||||||
|
_use_test(int argc, const char **argv, const char *test_case)
|
||||||
|
{
|
||||||
|
if (argc < 1)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
for (; argc > 0; argc--, argv++)
|
||||||
|
if (strcmp(test_case, *argv) == 0)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Suite *
|
||||||
|
edje_suite_build(int argc, const char **argv)
|
||||||
|
{
|
||||||
|
TCase *tc;
|
||||||
|
Suite *s;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
s = suite_create("Edje");
|
||||||
|
|
||||||
|
for (i = 0; etc[i].test_case; ++i)
|
||||||
|
{
|
||||||
|
if (!_use_test(argc, argv, etc[i].test_case)) continue;
|
||||||
|
tc = tcase_create(etc[i].test_case);
|
||||||
|
|
||||||
|
etc[i].build(tc);
|
||||||
|
|
||||||
|
suite_add_tcase(s, tc);
|
||||||
|
tcase_set_timeout(tc, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Suite *s;
|
||||||
|
SRunner *sr;
|
||||||
|
int i, failed_count;
|
||||||
|
|
||||||
|
for (i = 1; i < argc; i++)
|
||||||
|
if ((strcmp(argv[i], "-h") == 0) ||
|
||||||
|
(strcmp(argv[i], "--help") == 0))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage:\n\t%s [test_case1 .. [test_caseN]]\n",
|
||||||
|
argv[0]);
|
||||||
|
_list_tests();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if ((strcmp(argv[i], "-l") == 0) ||
|
||||||
|
(strcmp(argv[i], "--list") == 0))
|
||||||
|
{
|
||||||
|
_list_tests();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
s = edje_suite_build(argc - 1, (const char **)argv + 1);
|
||||||
|
sr = srunner_create(s);
|
||||||
|
|
||||||
|
srunner_run_all(sr, CK_ENV);
|
||||||
|
failed_count = srunner_ntests_failed(sr);
|
||||||
|
srunner_free(sr);
|
||||||
|
|
||||||
|
return (failed_count == 0) ? 0 : 255;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef _EDJE_SUITE_H
|
||||||
|
#define _EDJE_SUITE_H
|
||||||
|
|
||||||
|
#include <check.h>
|
||||||
|
|
||||||
|
void edje_test_edje(TCase *tc);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _EDJE_SUITE_H */
|
|
@ -0,0 +1,28 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Eina.h>
|
||||||
|
#include <Edje.h>
|
||||||
|
|
||||||
|
#include "edje_suite.h"
|
||||||
|
|
||||||
|
START_TEST(edje_test_edje_init)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = edje_init();
|
||||||
|
fail_if(ret != 1);
|
||||||
|
|
||||||
|
ret = edje_shutdown();
|
||||||
|
fail_if(ret != 0);
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
|
void edje_test_edje(TCase *tc)
|
||||||
|
{
|
||||||
|
tcase_add_test(tc, edje_test_edje_init);
|
||||||
|
}
|
Loading…
Reference in New Issue