Root/
Source at commit 809e8142b53ba7227241d39d2c4057f7201087a9 created 9 years 2 months ago. By Werner Almesberger, gui.c (change_world): don't change color of the active frame | |
---|---|
1 | #!/bin/sh |
2 | # |
3 | # Common - Elements shared by all regression tests for fped |
4 | # |
5 | # Written 2010, 2011 by Werner Almesberger |
6 | # Copyright 2010, 2011 Werner Almesberger |
7 | # |
8 | # This program is free software; you can redistribute it and/or modify |
9 | # it under the terms of the GNU General Public License as published by |
10 | # the Free Software Foundation; either version 2 of the License, or |
11 | # (at your option) any later version. |
12 | # |
13 | |
14 | |
15 | fped() |
16 | { |
17 | echo -n "$1: " 1>&2 |
18 | shift |
19 | cat >_in |
20 | $VALGRIND ${FPED:-../fped} -T _in "$@" >_out 2>&1 || { |
21 | echo FAILED "($SCRIPT)" 1>&2 |
22 | cat _out |
23 | rm -f _in _out |
24 | exit 1 |
25 | } |
26 | rm -f _in |
27 | } |
28 | |
29 | |
30 | fped_dump() |
31 | { |
32 | fped "$@" -T -T |
33 | } |
34 | |
35 | |
36 | fped_fail() |
37 | { |
38 | echo -n "$1: " 1>&2 |
39 | shift |
40 | cat >_in |
41 | $VALGRIND ${FPED:-../fped} -T _in "$@" >_out 2>&1 && { |
42 | echo FAILED "($SCRIPT)" 1>&2 |
43 | cat _out |
44 | rm -f _in _out |
45 | exit 1 |
46 | } |
47 | rm -f _in |
48 | } |
49 | |
50 | |
51 | expect() |
52 | { |
53 | diff -u - "$@" _out >_diff || { |
54 | echo FAILED "($SCRIPT)" 1>&2 |
55 | cat _diff 1>&2 |
56 | rm -f _out _diff |
57 | exit 1 |
58 | } |
59 | echo PASSED 1>&2 |
60 | rm -f _out _diff |
61 | passed=`expr ${passed:-0} + 1` |
62 | } |
63 | |
64 | |
65 | expect_grep() |
66 | { |
67 | grep "$1" <_out >_tmp || exit 1 |
68 | mv _tmp _out |
69 | shift |
70 | expect "$@" |
71 | } |
72 | |
73 | |
74 | expect_sed() |
75 | { |
76 | sed "$1" <_out >_tmp || exit 1 |
77 | mv _tmp _out |
78 | shift |
79 | expect "$@" |
80 | } |
81 | |
82 | |
83 | if [ ! -z "$CWD_PREFIX" -a ! -z "$FPED" -a "$FPED" = "${FPED#/}" ]; then |
84 | FPED="$CWD_PREFIX/$FPED" |
85 | fi |
86 |
Branches:
master