This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via cb2c440163c18fe8cdbe96969ea28fe38da3fb56 (commit) from abee71632bc9666b9b9c483868f17c9920be6343 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/cb2c440163c18fe8cdbe96969ea28fe38da3f...
commit cb2c440163c18fe8cdbe96969ea28fe38da3fb56 Author: Cyril Hrubis metan@ucw.cz Date: Fri Mar 8 13:46:32 2013 +0100
tests: filters: Add dump API Coverage generator.
diff --git a/tests/filters/APICoverage.gen.c.t b/tests/filters/APICoverage.gen.c.t new file mode 100644 index 0000000..3b46006 --- /dev/null +++ b/tests/filters/APICoverage.gen.c.t @@ -0,0 +1,140 @@ +/***************************************************************************** + * This file is part of gfxprim library. * + * * + * Gfxprim is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * Gfxprim is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with gfxprim; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + + /* + + The purpose of this test is to exercise as much codepaths as possible + without checking for result corectness. + + */ + +%% extends "base.test.c.t" + +%% block body + +#include <stdio.h> + +#include <core/GP_Context.h> +#include <filters/GP_Filters.h> + +#include "tst_test.h" + +%% set API_List = [['MirrorH', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['MirrorH_Alloc', 'GP_Context:in', 'GP_ProgressCallback'], + + ['MirrorV', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['MirrorV_Alloc', 'GP_Context:in', 'GP_ProgressCallback'], + + ['Rotate90', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['Rotate90_Alloc', 'GP_Context:in', 'GP_ProgressCallback'], + + ['Rotate180', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['Rotate180_Alloc', 'GP_Context:in', 'GP_ProgressCallback'], + + ['Rotate270', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['Rotate270_Alloc', 'GP_Context:in', 'GP_ProgressCallback'], + + ['GaussianBlur', 'GP_Context:in', 'GP_Context:out', + 'float:sigma_x', 'float:sigma_y', 'GP_ProgressCallback'], + ['GaussianBlurAlloc', 'GP_Context:in', 'float:sigma_x', + 'float:sigma_y', 'GP_ProgressCallback'], + + ['GaussianNoiseAdd', 'GP_Context:in', 'GP_Context:out', + 'float:sigma', 'float:mu', 'GP_ProgressCallback'], + ['GaussianNoiseAddAlloc', 'GP_Context:in', + 'float:sigma', 'float:mu', 'GP_ProgressCallback'], + + ['Median', 'GP_Context:in', 'GP_Context:out', + 'int:xmed', 'int:ymed', 'GP_ProgressCallback'], + ['MedianAlloc', 'GP_Context:in', + 'int:xmed', 'int:ymed', 'GP_ProgressCallback'], + + ['Sigma', 'GP_Context:in', 'GP_Context:out', + 'int:xrad', 'int:yrad', 'int:min', 'float:sigma', 'GP_ProgressCallback'], + ['SigmaAlloc', 'GP_Context:in', + 'int:xrad', 'int:yrad', 'int:min', 'float:sigma', 'GP_ProgressCallback'], + + ['ResizeNN', 'GP_Context:in', 'GP_Context:out', 'GP_ProgressCallback'], + ['ResizeNNAlloc', 'GP_Context:in', 'int:w', 'int:h', 'GP_ProgressCallback'], +] + +%% macro prep_context(id, pt) + GP_Context *{{ id }} = GP_ContextAlloc(113, 900, GP_PIXEL_{{ pt.name }}); +%% endmacro + +%% macro prep_float(id) + float {{ id }} = 1; +%% endmacro + +%% macro prep_int(id) + int {{ id }} = 2; +%% endmacro + +%% macro prep_param(param, pt) +%% if (param.split(':', 1)[0] == 'GP_Context') +{{ prep_context(param.split(':', 1)[1], pt) }} +%% endif +%% if (param.split(':', 1)[0] == 'float') +{{ prep_float(param.split(':', 1)[1]) }} +%% endif +%% if (param.split(':', 1)[0] == 'int') +{{ prep_int(param.split(':', 1)[1]) }} +%% endif +%% endmacro + +{% macro get_param(param) %}{% if len(param.split(':', 1)) == 1 %}NULL{% else %}{{ param.split(':', 1)[1] }}{% endif %}{% endmacro %} + +%% for pt in pixeltypes +%% if not pt.is_unknown() +%% for fn in API_List + +static int Filter_{{ fn[0]}}_{{ pt.name }}(void) +{ +%% for param in fn[1:] +{{ prep_param(param, pt) }} +%% endfor + + GP_Filter{{ fn[0] }}({{ get_param(fn[1]) }}{% for param in fn[2:] %}, {{ get_param(param) }}{% endfor %}); + + return TST_SUCCESS; +} + +%% endfor +%% endif +%% endfor + +const struct tst_suite tst_suite = { + .suite_name = "Filters API Coverage", + .tests = { +%% for fn in API_List +%% for pt in pixeltypes +%% if not pt.is_unknown() + {.name = "Filter {{ fn[0] }} {{ pt.name }}", + .tst_fn = Filter_{{ fn[0] }}_{{ pt.name }}}, +%% endif +%% endfor +%% endfor + {.name = NULL} + } +}; + +%% endblock body diff --git a/tests/filters/Makefile b/tests/filters/Makefile index b0a590d..bda08a5 100644 --- a/tests/filters/Makefile +++ b/tests/filters/Makefile @@ -1,13 +1,16 @@ TOPDIR=../.. include $(TOPDIR)/pre.mk
-CSOURCES=$(shell echo *.c) +CSOURCES=FilterMirrorH.c
-APPS=FilterMirrorH +GENSOURCES=APICoverage.gen.c + +APPS=FilterMirrorH APICoverage.gen
include ../tests.mk
FilterMirrorH: common.o
+include $(TOPDIR)/gen.mk include $(TOPDIR)/app.mk include $(TOPDIR)/post.mk diff --git a/tests/filters/runtest.sh b/tests/filters/runtest.sh index c820af1..6b11a77 100755 --- a/tests/filters/runtest.sh +++ b/tests/filters/runtest.sh @@ -10,3 +10,4 @@ export LIBC_FATAL_STDERR_=1
LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./FilterMirrorH "$@" +LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./APICoverage.gen "$@" diff --git a/tests/filters/test_list.txt b/tests/filters/test_list.txt index 2f9a127..4b3dee1 100644 --- a/tests/filters/test_list.txt +++ b/tests/filters/test_list.txt @@ -1,3 +1,4 @@ # Filters test list
+APICoverage.gen FilterMirrorH
-----------------------------------------------------------------------
Summary of changes: tests/filters/APICoverage.gen.c.t | 140 +++++++++++++++++++++++++++++++++++++ tests/filters/Makefile | 7 ++- tests/filters/runtest.sh | 1 + tests/filters/test_list.txt | 1 + 4 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 tests/filters/APICoverage.gen.c.t
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.