forked from bonzini/smalltalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.at
executable file
·79 lines (73 loc) · 2.84 KB
/
local.at
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
dnl Local Autotest macros for GNU Smalltalk.
dnl
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl AT_CHECK_GST([COMMAND-LINE], [IMAGE], [DIR], [STDOUT], [STDERR])
dnl ----------------------------------------------------------------
m4_define([AT_CHECK_GST], [
case $AUTOTEST_PATH in
tests) image_path="-I m4_ifval([$2], [$2], [$abs_top_builddir/gst.im])" ;;
*) image_path="m4_ifval([$2], [-I $2])" ;;
esac
echo "{ (cd m4_ifval([$3], [$3], [$abs_top_builddir]) && gst $image_path $1); echo exit $? > retcode; } | tr -d '\r' | tee stdout; . ./retcode"
AT_CHECK([{ (cd m4_ifval([$3], [$3], [$abs_top_builddir]) && gst $image_path $1); echo exit $? > retcode; } | tr -d '\r' | tee stdout; . ./retcode], 0, [$4], [$5])
])
dnl AT_DIFF_TEST([FILE], [XFAILS])
dnl ------------------------------
m4_define([AT_DIFF_TEST], [
AT_SETUP([$1])
AT_KEYWORDS([base])
$2
cat $abs_srcdir/m4_bpatsubst([$1], [\.st$], [.ok]) > expout
AT_CHECK_GST([-r $1 2>&1], [], [$abs_srcdir], [expout])
AT_CLEANUP
])
dnl AT_PACKAGE_TEST([PACKAGE], [XFAILS], [VARS], [CONDITION])
dnl ---------------------------------------------------------
m4_define([AT_PACKAGE_TEST], [
AT_SETUP([$1])
AT_KEYWORDS([m4_if([$1], [SUnit], [], [$1 ])SUnit])
$2
m4_ifval([$4], [AT_CHECK([$4 || exit 77])])
AT_CHECK_GST([-f $abs_top_srcdir/scripts/Test.st --verbose $3 -p $1], [], [], [ignore])
AT_CLEANUP
])
dnl AT_OPTIONAL_PACKAGE_TEST([PACKAGE], [XFAILS], [VARS], [CONDITION])
dnl ------------------------------------------------------------------
dnl Returns exit code 77 (skip) if the package cannot be loaded.
m4_define([AT_OPTIONAL_PACKAGE_TEST], [
AT_SETUP([$1])
AT_KEYWORDS([$1 SUnit])
$2
m4_ifval([$4], [AT_CHECK([$4 || exit 77])])
AT_CHECK_GST([-f $abs_top_srcdir/scripts/Test.st --verbose $3 -p $1
ret=$?
case $ret in
2) exit 77 ;;
0|1) exit $ret ;;
esac], [], [], [ignore])
AT_CLEANUP
])
dnl AT_ANSI_TEST([PACKAGE], [XFAILS])
dnl ---------------------------------
m4_define([AT_ANSI_TEST], [
AT_SETUP([$1])
AT_KEYWORDS([ANSI SUnit])
$2
AT_CHECK_GST([-f $abs_srcdir/AnsiRun.st $1], [$abs_builddir/gst.im], [], [ignore])
AT_CLEANUP
])