Commit afefd842 authored by Roland Levillain's avatar Roland Levillain
Browse files

Update Scribo's unit tests generator.

	* tests/unit_test/build_unit_test.sh: Catch up with Milena's
	version of this script.
	* tests/unit_test/Makefile.am (regen-am, $(srcdir)/unit-tests.mk):
	Adjust.
	* tests/unit_test/disabled_tests: New.
parent 6dd7d249
2010-04-21 Roland Levillain <roland@lrde.epita.fr>
Update Scribo's unit tests generator.
* tests/unit_test/build_unit_test.sh: Catch up with Milena's
version of this script.
* tests/unit_test/Makefile.am (regen-am, $(srcdir)/unit-tests.mk):
Adjust.
* tests/unit_test/disabled_tests: New.
2010-04-09 Roland Levillain <roland@lrde.epita.fr>
Help g++ 4.1 compile Scribo.
......
# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
......@@ -22,8 +22,11 @@ include $(top_srcdir)/scribo/tests/tests.mk
# Regen files.
include $(top_srcdir)/build-aux/regen-recursive.mk
regen-am:
cd $(srcdir) \
&& ./build_unit_test.sh $(abs_top_srcdir)/scribo .
cd $(top_srcdir) \
&& scribo/tests/unit_test/build_unit_test.sh \
scribo \
scribo/tests/unit_test \
scribo/tests/unit_test/disabled_tests
# FIXME: Change build_unit_test.sh so that the action looks like this:
#
......@@ -31,9 +34,12 @@ regen-am:
#
# `$(abs_top_srcdir)' is required because of the change of directory
# at the beginning og the action.
$(srcdir)/unit-tests.mk: $(srcdir)/build_unit_test.sh
cd $(srcdir) \
&& ./build_unit_test.sh $(abs_top_srcdir)/scribo .
$(srcdir)/unit-tests.mk: build_unit_test.sh disabled_tests
cd $(top_srcdir) \
&& scribo/tests/unit_test/build_unit_test.sh \
scribo \
scribo/tests/unit_test \
scribo/tests/unit_test/disabled_tests
include $(srcdir)/unit-tests.mk
......
#! /bin/sh
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
# (LRDE)
#
# This file is part of Olena.
#
# Olena is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, version 2 of the License.
#
# Olena 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
## FIXME: Unify with build-aux/build_unit_test.sh.
## FIXME: Don't use `echo -n', as echo's options are not portable.
##
## http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtins.html#Limitations-of-Builtins
......@@ -11,19 +30,18 @@ ECHO_N=printf
# Use the C locale to have a deterministic sort.
export LC_ALL=C
test $# -eq 2 || { echo "Usage: $0 <scribo path> <output path>" && exit 1; }
test $# -eq 3 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests>" && exit 1; }
scanned_dir=$1
output_dir=$2
disabled_tests=$3
## FIXME: Ouch! Using `find' properly can probably save us some pipes,
## forks and characters here.
HEADERS=`find $1 -name "*.hh" \
| grep -vE "*.spe.hh" \
| grep -v "recognition" \
| grep -v "demo" \
| sort \
| sed -e 's/.*\/scribo\/\(.*\)/scribo\/\1/g' \
| sed 's/\.\.\/\.\.\///g'`
HEADERS=$(find $scanned_dir -type f -name "*.hh" \
| sort \
| sed -e 's/.*\/scribo\/\(.*\)/scribo\/\1/g' | sed 's/\.\.\/\.\.\///g' \
| comm -23 - "$disabled_tests")
output=$2/unit-tests.mk
output="$output_dir/unit-tests.mk"
rm -f "$output"
rm -f scribo_*.cc
......@@ -37,7 +55,7 @@ for i in $HEADERS; do
FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
# Build .cc.
cat > $FILE_CC << EOF
cat > "$output_dir/$FILE_CC" << EOF
// Unit test for $i.
// Generated by $0, do not modify.
......
scribo/demo/src/mainwindow.hh
scribo/text/recognition.hh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment