update isl for change in representation of isl_constraint
[ppcg.git] / clan / tests / checker.sh
blob7de0db93f5fedbbfa1a7eba3dbbfc51e35efe217
1 #! /bin/sh
3 # /**------- <| --------------------------------------------------------**
4 # ** A Clan **
5 # **--- /.\ -----------------------------------------------------**
6 # ** <| [""M# checker.sh **
7 # **- A | # -----------------------------------------------------**
8 # ** /.\ [""M# First version: 30/04/2008 **
9 # **- [""M# | # U"U#U -----------------------------------------------**
10 # | # | # \ .:/
11 # | # | #___| #
12 # ****** | "--' .-" *****************************************************
13 # * |"-"-"-"-"-#-#-## Clan : the Chunky Loop Analyser (experimental) *
14 # **** | # ## ###### ****************************************************
15 # * \ .::::'/ *
16 # * \ ::::'/ Copyright (C) 2008 Cedric Bastoul *
17 # * :8a| # # ## *
18 # * ::88a ### This is free software; you can redistribute it *
19 # * ::::888a 8a ##::. and/or modify it under the terms of the GNU *
20 # * ::::::::888a88a[]::: Lesser General Public License as published by *
21 # *::8:::::::::SUNDOGa8a::. the Free Software Foundation, either version 3 of *
22 # *::::::::8::::888:Y8888:: the License, or (at your option) *
23 # *::::':::88::::888::Y88a::::::::::::... any later version. *
24 # *::'::.. . ..... .. ... . *
25 # * This software is distributed in the hope that it will be useful, but *
26 # * WITHOUT ANY WARRANTY; without even the implied warranty of *
27 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
28 # * Public License for more details. *
29 # * *
30 # * You should have received a copy of the GNU Lesser General Public *
31 # * License along with software; if not, write to the Free Software *
32 # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
33 # * *
34 # * Clan, the Chunky Loop Analyser *
35 # * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
36 # * *
37 # *****************************************************************************/
39 output=0
40 nb_tests=0;
41 TEST_FILES="$2";
42 echo "[CHECK:] $1";
43 for i in $TEST_FILES; do
44 nb_tests=$(($nb_tests + 1))
45 outtemp=0
46 echo "[TEST:] Source parser test:== $i ==";
47 $top_builddir/source/clan $i -arraystag > $i.test 2>/tmp/clanout
48 z=`diff --ignore-matching-lines='generated by ' $i.test $i.scop 2>&1`
49 err=`cat /tmp/clanout`;
50 if ! [ -z "$z" ]; then
51 echo -e "\033[31m[FAIL:] Source parser test: Wrong .scop generated\033[0m";
52 outtemp=1;
53 output=1
55 if ! [ -z "$err" ]; then
56 if [ $outtemp = "0" ]; then
57 echo "[INFO:] Source parser test: .scop OK";
59 echo -e "\033[31m[FAIL:] Source parser test: stderr output: $err\033[0m";
60 outtemp=1
61 output=1
63 if [ $outtemp = "0" ]; then
64 echo "[PASS:] Source parser test: .scop OK";
65 rm -f $i.test
67 rm -f /tmp/clanout
68 echo "[TEST:] .SCoP parser test:== $i.scop ==";
69 $top_builddir/source/clan -inputscop $i.scop > $i.parsetest
70 z=`diff --ignore-matching-lines='generated by ' $i.parsetest $i.scop`
71 if ! [ -z "$z" ]; then
72 echo -e "\033[31m[FAIL:] .SCoP parser test: $i\033[0m";
73 outtemp=1
74 output=1
75 else
76 echo "[PASS:] .SCoP parser test: .scop re-OK";
77 rm -f $i.parsetest
79 done
80 if [ $output = "1" ]; then
81 echo -e "\033[31m[FAIL:] $1\033[0m";
82 else
83 echo "[PASS:] $1 ($nb_tests + $nb_tests tests)";
85 exit $output