
* tests/unit_test/build_unit_test.sh, * generate_dist_headers.sh: remove since moved to build-aux. * Makefile.am, * tests/unit_test/Makefile.am: make use of the new scripts in build-aux. * tests/unit_test/disabled_tests: add a list of disabled unit tests. * headers.mk, * tests/unit_test/unit-tests.mk: regen. --- milena/ChangeLog | 16 +++++ milena/Makefile.am | 8 +- milena/generate_dist_headers.sh | 33 ---------- milena/headers.mk | 5 +- milena/tests/unit_test/Makefile.am | 17 +++-- milena/tests/unit_test/build_unit_test.sh | 96 ----------------------------- milena/tests/unit_test/disabled_tests | 43 +++++++++++++ milena/tests/unit_test/unit-tests.mk | 4 +- 8 files changed, 78 insertions(+), 144 deletions(-) delete mode 100755 milena/generate_dist_headers.sh delete mode 100755 milena/tests/unit_test/build_unit_test.sh create mode 100644 milena/tests/unit_test/disabled_tests diff --git a/milena/ChangeLog b/milena/ChangeLog index 6a2f751..62025ee 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,19 @@ +2009-06-19 Guillaume Lazzara <guillaume.lazzara@lrde.epita.fr> + + Use new scripts located in build-aux. + + * tests/unit_test/build_unit_test.sh, + * generate_dist_headers.sh: remove since moved to build-aux. + + * Makefile.am, + * tests/unit_test/Makefile.am: make use of the new scripts in + build-aux. + + * tests/unit_test/disabled_tests: add a list of disabled unit tests. + + * headers.mk, + * tests/unit_test/unit-tests.mk: regen. + 2009-06-18 Thierry Geraud <thierry.geraud@lrde.epita.fr> Augment demo on neighborhood genericity. diff --git a/milena/Makefile.am b/milena/Makefile.am index c498a7a..5e06f1b 100644 --- a/milena/Makefile.am +++ b/milena/Makefile.am @@ -70,15 +70,15 @@ REGEN_SUBDIRS += doc tests # # Hence the redundant action. There may be a better solution regen-am: - cd $(srcdir) && ./generate_dist_headers.sh + cd $(srcdir) && $(top_srcdir)/build-aux/generate_dist_headers.sh mln ./headers.mk ./nodist-headers -EXTRA_DIST = generate_dist_headers.sh nodist-headers +EXTRA_DIST = nodist-headers # FIXME: Change generate_dist_headers.sh so that the action looks like this: # # $< $@.tmp && mv -f $@.tmp $@ && chmod -w $@ # -$(srcdir)/headers.mk: $(srcdir)/generate_dist_headers.sh nodist-headers - cd $(srcdir) && ./generate_dist_headers.sh +$(srcdir)/headers.mk: $(top_srcdir)/build-aux/generate_dist_headers.sh nodist-headers + cd $(srcdir) && $(top_srcdir)/build-aux/generate_dist_headers.sh mln ./headers.mk ./nodist-headers include $(srcdir)/headers.mk diff --git a/milena/generate_dist_headers.sh b/milena/generate_dist_headers.sh deleted file mode 100755 index 18ee545..0000000 --- a/milena/generate_dist_headers.sh +++ /dev/null @@ -1,33 +0,0 @@ -#! /bin/sh - -# Generate headers.mk. -# -------------------- -# List all the headers in order to make them part of distribution. - -# Use the C locale to have a deterministic sort. -export LC_ALL=C - -me=`basename $0` -# FIXME: OUTPUT and NODIST_HEADERS should be arguments of the script. -output=headers.mk -nodist_headers=nodist-headers -test -f "$nodist_headers" \ - || { echo "$me: Cannot find \`$nodist_headers' in `pwd`."; exit 1; } - -echo "Generating $output..." >&2 -rm -f "$output" -cat <<EOF >"$output" -## Generated by \`$me', do not edit by hand. - -nobase_include_HEADERS = \\ -EOF - -find mln -type f -a \( -name '*.hh' -o -name '*.hxx' \) \ - | sort \ - | comm -23 - "$nodist_headers" \ - | sed -e 's/$/ \\/g' >> headers.mk - -last_line=`tail -n 1 headers.mk | sed -e 's/\\\//g'` # remove '\' in last line -sed '$d' < headers.mk > headers.mk.tmp # remove last line -mv headers.mk.tmp headers.mk -echo $last_line >> headers.mk # put the cleaned last line back. diff --git a/milena/headers.mk b/milena/headers.mk index 709363a..6fa4c1c 100644 --- a/milena/headers.mk +++ b/milena/headers.mk @@ -7,6 +7,7 @@ mln/accu/compute.hh \ mln/accu/convolve.hh \ mln/accu/count_adjacent_vertices.hh \ mln/accu/count_labels.hh \ +mln/accu/count_value.hh \ mln/accu/essential.hh \ mln/accu/histo.hh \ mln/accu/image/all.hh \ @@ -31,9 +32,7 @@ mln/accu/maj_h.hh \ mln/accu/math/all.hh \ mln/accu/math/count.hh \ mln/accu/math/essential.hh \ -mln/accu/math/inf.hh \ mln/accu/math/sum.hh \ -mln/accu/math/sup.hh \ mln/accu/max_site.hh \ mln/accu/nil.hh \ mln/accu/p.hh \ @@ -503,9 +502,7 @@ mln/fun/internal/selector.hh \ mln/fun/internal/x2x_linear_impl.hh \ mln/fun/math/abs.hh \ mln/fun/math/cos.hh \ -mln/fun/math/inf.hh \ mln/fun/math/norm.hh \ -mln/fun/math/sup.hh \ mln/fun/meta/impl.hh \ mln/fun/ops.hh \ mln/fun/p2b/all.hh \ diff --git a/milena/tests/unit_test/Makefile.am b/milena/tests/unit_test/Makefile.am index 3ea19b7..5b9ef8f 100644 --- a/milena/tests/unit_test/Makefile.am +++ b/milena/tests/unit_test/Makefile.am @@ -22,19 +22,24 @@ include $(top_srcdir)/milena/tests/tests.mk # Regen files. include $(top_srcdir)/build-aux/regen-recursive.mk regen-am: - cd $(srcdir) \ - && ./build_unit_test.sh $(abs_top_srcdir)/milena/mln + cd $(top_srcdir) \ + && ./build-aux/build_unit_test.sh \ + milena/mln \ + milena/tests/unit_test \ + milena/tests/unit_test/disabled_tests -EXTRA_DIST = build_unit_test.sh # FIXME: Change build_unit_test.sh so that the action looks like this: # # $< $@.tmp && mv -f $@.tmp $@ && chmod -w $@ # # `$(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)/milena/mln +$(srcdir)/unit-tests.mk: $(top_srcdir)/build-aux/build_unit_test.sh + cd $(top_srcdir) \ + && ./build-aux/build_unit_test.sh \ + milena/mln \ + milena/tests/unit_test \ + milena/tests/unit_test/disabled_tests include $(srcdir)/unit-tests.mk diff --git a/milena/tests/unit_test/build_unit_test.sh b/milena/tests/unit_test/build_unit_test.sh deleted file mode 100755 index ae31679..0000000 --- a/milena/tests/unit_test/build_unit_test.sh +++ /dev/null @@ -1,96 +0,0 @@ -#! /bin/sh - -# Copyright (C) 2007, 2009 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: Don't use `echo -n', as echo's options are not portable. -## -## http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtin... -## -## As an ugly workaround, use `printf' instead. The right approach -## would be to only emit lines ended with newlines. -ECHO_N=printf - -# Use the C locale to have a deterministic sort. -export LC_ALL=C - -test $# -eq 1 || { echo "Usage: $0 <mln path>" && exit 1; } - -## FIXME: Ouch! Using `find' properly can probably save us some pipes, -## forks and characters here. -## -## FIXME: We do not include these directories -## -## mln/io/dicom -## mln/io/fits -## mln/io/magick -## mln/io/tiff -## -## because they contain files depending on optional (external) -## libraries. We should test them conditionally. -HEADERS=$(find $1 -name "*.hh" \ - | grep -vE "*.spe.hh" \ - | grep -v "mln/core/concept/doc" \ - | grep -v "mln/io/dicom" \ - | grep -v "mln/io/fits" \ - | grep -v "mln/io/magick" \ - | grep -v "mln/io/tiff" \ - | sort \ - | sed -e 's/.*\/mln\/\(.*\)/mln\/\1/g' | sed 's/\.\.\/\.\.\///g') - -output=unit-tests.mk - -rm -f "$output" -rm -f mln_*.cc - -# Build unit-tests.mk. -echo "## Generated by $0, do not modify." >"$output" -echo >>"$output" -$ECHO_N "check_PROGRAMS = " >>"$output" - -for i in $HEADERS; do - FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'` - - # Build .cc. - cat > $FILE_CC << EOF -// Unit test for $i. -// Generated by $0, do not modify. - -// Include the file twice, so we detect missing inclusion guards. -#include <$i> -#include <$i> - -int main() -{ - // Nothing. -} -EOF - - # Build unit-tests.mk. - TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'` - echo " \\" >>"$output" - $ECHO_N "${TARGET}" >>"$output" -done - -# Build "$output". -echo "" >>"$output" -echo "" >>"$output" -for i in $HEADERS; do - FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'` - NAME=`echo $FILE_CC | sed 's/\.cc//g'` - echo "${NAME}_SOURCES = $FILE_CC" >>"$output" -done diff --git a/milena/tests/unit_test/disabled_tests b/milena/tests/unit_test/disabled_tests new file mode 100644 index 0000000..3943e70 --- /dev/null +++ b/milena/tests/unit_test/disabled_tests @@ -0,0 +1,43 @@ +mln/arith/div.spe.hh +mln/arith/min.spe.hh +mln/arith/revert.spe.hh +mln/arith/times.spe.hh +mln/core/concept/doc/accumulator.hh +mln/core/concept/doc/box.hh +mln/core/concept/doc/dpoint.hh +mln/core/concept/doc/generalized_pixel.hh +mln/core/concept/doc/image.hh +mln/core/concept/doc/image_fastest.hh +mln/core/concept/doc/iterator.hh +mln/core/concept/doc/neighborhood.hh +mln/core/concept/doc/object.hh +mln/core/concept/doc/pixel_iterator.hh +mln/core/concept/doc/point_iterator.hh +mln/core/concept/doc/point_site.hh +mln/core/concept/doc/site_set.hh +mln/core/concept/doc/value_iterator.hh +mln/core/concept/doc/value_set.hh +mln/core/concept/doc/weighted_window.hh +mln/core/concept/doc/window.hh +mln/data/apply.spe.hh +mln/data/fill_with_image.spe.hh +mln/data/fill_with_value.spe.hh +mln/data/paste.spe.hh +mln/data/transform.spe.hh +mln/debug/iota.spe.hh +mln/debug/println.spe.hh +mln/debug/println_with_border.spe.hh +mln/histo/compute.spe.hh +mln/io/dicom/all.hh +mln/io/dicom/load.hh +mln/io/fits/all.hh +mln/io/fits/load.hh +mln/io/magick/all.hh +mln/io/magick/load.hh +mln/io/magick/save.hh +mln/io/tiff/all.hh +mln/io/tiff/load.hh +mln/io/tiff/save.hh +mln/labeling/value.spe.hh +mln/logical/not.spe.hh +mln/morpho/general.spe.hh diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk index ad78d35..5dccbe2 100644 --- a/milena/tests/unit_test/unit-tests.mk +++ b/milena/tests/unit_test/unit-tests.mk @@ -1,4 +1,4 @@ -## Generated by ./build_unit_test.sh, do not modify. +## Generated by ./build-aux/build_unit_test.sh, do not modify. check_PROGRAMS = \ mln_accu_all \ @@ -7,6 +7,7 @@ mln_accu_compute \ mln_accu_convolve \ mln_accu_count_adjacent_vertices \ mln_accu_count_labels \ +mln_accu_count_value \ mln_accu_essential \ mln_accu_histo \ mln_accu_image_all \ @@ -1267,6 +1268,7 @@ mln_accu_compute_SOURCES = mln_accu_compute.cc mln_accu_convolve_SOURCES = mln_accu_convolve.cc mln_accu_count_adjacent_vertices_SOURCES = mln_accu_count_adjacent_vertices.cc mln_accu_count_labels_SOURCES = mln_accu_count_labels.cc +mln_accu_count_value_SOURCES = mln_accu_count_value.cc mln_accu_essential_SOURCES = mln_accu_essential.cc mln_accu_histo_SOURCES = mln_accu_histo.cc mln_accu_image_all_SOURCES = mln_accu_image_all.cc -- 1.5.6.5