[PPL-devel] [GIT] ppl/ppl(floating_point): Added some infrastructure to perform parametric tests.

Roberto Bagnara bagnara at cs.unipr.it
Tue Sep 22 17:58:31 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: c142c06f9e4788c00e65dc0cfb999feb0402d4b1
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=c142c06f9e4788c00e65dc0cfb999feb0402d4b1

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Tue Sep 22 17:56:33 2009 +0200

Added some infrastructure to perform parametric tests.

---

 tests/Floating_Point_Expression/.gitignore  |    1 +
 tests/Floating_Point_Expression/Makefile.am |  110 +++++++++++++++++++++++----
 tests/Floating_Point_Expression/run_tests   |   55 +++++++++++++
 3 files changed, 152 insertions(+), 14 deletions(-)

diff --git a/tests/Floating_Point_Expression/.gitignore b/tests/Floating_Point_Expression/.gitignore
new file mode 100644
index 0000000..ee6ecf8
--- /dev/null
+++ b/tests/Floating_Point_Expression/.gitignore
@@ -0,0 +1 @@
+dirty_marker
diff --git a/tests/Floating_Point_Expression/Makefile.am b/tests/Floating_Point_Expression/Makefile.am
index 1c10370..5df7796 100755
--- a/tests/Floating_Point_Expression/Makefile.am
+++ b/tests/Floating_Point_Expression/Makefile.am
@@ -36,10 +36,11 @@ endif !VALGRIND_TESTS_ENABLED
 TESTS_ENVIRONMENT = $(CHECKER)
 
 AM_CPPFLAGS = \
--I$(top_srcdir)/src \
+$(TEST_CPPFLAGS) \
 -I$(top_builddir)/src \
--I$(top_srcdir)/utils \
+-I$(top_srcdir)/src \
 -I$(top_srcdir)/tests \
+-I$(top_srcdir)/utils \
 @extra_includes@ \
 @debug_flag@
 
@@ -49,34 +50,115 @@ $(top_builddir)/tests/libppl_tests.a \
 $(top_builddir)/src/libppl.la \
 @extra_libraries@
 
-TESTS = linearform1 \
+ORIGINAL_TESTS = \
+bdshape1 \
 floatingpointexpr1 \
+linearform1 \
 octagonalshape1 \
-octagonalshape2 \
-bdshape1
+octagonalshape2
+
+DERIVED_TESTS =
+
+ALL_TESTS = $(ORIGINAL_TESTS) $(DERIVED_TESTS)
+
+# This will be overridden by the `run_tests' script.
+TEST_CPPFLAGS=-DANALYZER_FP_FORMAT=fl_r_oc -DANALYZED_FP_FORMAT=float_ieee754_half
+
+dist_check_SCRIPTS = run_tests
+
+TESTS = run_tests.stamp
+
+.PHONY: run_tests.stamp
+run_tests.stamp: run_tests
+	+MAKE=$(MAKE) $(srcdir)/run_tests
+	echo "true" >run_tests.stamp
+	chmod +x run_tests.stamp
 
 XFAIL_TESTS =
 
-BUGS =
+# Do not change the ordering in what follows.
+if SUPPORTED_FLOAT
+FLOAT_INSTANCES= \
+fl_r_oc/float_ieee754_half \
+fl_r_oc/float_ieee754_single \
+fl_r_oc/float_ieee754_double \
+fl_r_oc/float_ieee754_quad \
+fl_r_oc/float_ibm_single \
+fl_r_oc/float_ibm_double \
+fl_r_oc/float_intel_double_extended
+endif
+if SUPPORTED_DOUBLE
+DOUBLE_INSTANCES= \
+db_r_oc/float_ieee754_half \
+db_r_oc/float_ieee754_single \
+db_r_oc/float_ieee754_double \
+db_r_oc/float_ieee754_quad \
+db_r_oc/float_ibm_single \
+db_r_oc/float_ibm_double \
+db_r_oc/float_intel_double_extended
+endif
+if SUPPORTED_LONG_DOUBLE
+LONG_DOUBLE_INSTANCES= \
+ld_r_oc/float_ieee754_half \
+ld_r_oc/float_ieee754_single \
+ld_r_oc/float_ieee754_double \
+ld_r_oc/float_ieee754_quad \
+ld_r_oc/float_ibm_single \
+ld_r_oc/float_ibm_double \
+ld_r_oc/float_intel_double_extended
+endif
+
+# Do not change the ordering in what follows.
+INSTANCES = \
+$(FLOAT_INSTANCES) \
+$(DOUBLE_INSTANCES) \
+$(LONG_DOUBLE_INSTANCES)
+
+print_check_PROGRAMS:
+	echo $(check_PROGRAMS)
+
+print_INSTANCES:
+	echo $(INSTANCES)
+
 
 #
 # Sources for the tests
 #
 
-linearform1_SOURCES = linearform1.cc
+bdshape1_SOURCES = bdshape1.cc
+
 floatingpointexpr1_SOURCES = floatingpointexpr1.cc
+
+linearform1_SOURCES = linearform1.cc
+
 octagonalshape1_SOURCES = octagonalshape1.cc
+
 octagonalshape2_SOURCES = octagonalshape2.cc
-bdshape1_SOURCES = bdshape1.cc
 
-check_PROGRAMS = \
-$(TESTS) \
-$(WATCHDOG_TESTS) \
-$(BUGS)
 
-EXTRA_DIST =
+#
+# Sources and compilation flags for the derived check programs
+#
+
+DERIVED_CXXFLAGS = -DDERIVED_TEST $(AM_CXXFLAGS)
+
+#nnc_frompolyhedron1_SOURCES = frompolyhedron1.cc
+#nnc_frompolyhedron1_CXXFLAGS = $(DERIVED_CXXFLAGS)
+
+BUGS =
+
+check_PROGRAMS = $(ALL_TESTS) $(BUGS)
+
+#EXTRA_DIST = $(refinewithconstraints2_SRCS)
+
+#MOSTLYCLEANFILES = \
+#ascii_dump_load1.dat
+
+CLEANFILES = \
+run_tests.stamp
 
-MOSTLYCLEANFILES =
+DISTCLEANFILES = \
+dirty_marker
 
 $(top_builddir)/utils/libppl_utils.a:
 	$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/utils libppl_utils.a
diff --git a/tests/Floating_Point_Expression/run_tests b/tests/Floating_Point_Expression/run_tests
new file mode 100755
index 0000000..f72431a
--- /dev/null
+++ b/tests/Floating_Point_Expression/run_tests
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# Run the Floating_Point_Expression tests.
+# Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+#
+# This file is part of the Parma Polyhedra Library (PPL).
+#
+# The PPL 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; either version 3 of the License, or (at your
+# option) any later version.
+#
+# The PPL 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 this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+#
+# For the most up-to-date information see the Parma Polyhedra Library
+# site: http://www.cs.unipr.it/ppl/ .
+
+mpz_class_XFAIL_TESTS=
+mpq_class_XFAIL_TESTS=
+int8_t_XFAIL_TESTS=
+int16_t_XFAIL_TESTS=
+int32_t_XFAIL_TESTS=
+int64_t_XFAIL_TESTS=
+float_XFAIL_TESTS=
+double_XFAIL_TESTS=
+long_double_XFAIL_TESTS=
+
+if [ -z "$MAKE" ]
+then
+    MAKE=make
+fi
+
+instances=`MAKEFLAGS='' $MAKE -s print_INSTANCES`
+
+check_PROGRAMS=`MAKEFLAGS='' $MAKE -s print_check_PROGRAMS`
+
+for instance in $instances
+do
+  echo "**************************** " $instance " ****************************"
+  eval xfail_tests='"$'$instance'_XFAIL_TESTS"'
+  [ -f dirty_marker ] && $MAKE clean
+  touch dirty_marker
+  analyzer_fp_format=${instance%/*}
+  analyzed_fp_format=${instance#*/}
+  $MAKE check TESTS="$check_PROGRAMS" TESTS_ENVIRONMENT="$CHECKER" TEST_CPPFLAGS="-DANALYZER_FP_FORMAT=$analyzer_fp_format -DANALYZED_FP_FORMAT=$analyzed_fp_format" XFAIL_TESTS=$xfail_tests || exit 1
+  $MAKE clean && rm dirty_marker
+done
+exit 0




More information about the PPL-devel mailing list