[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
maint: minor changes in the test suite
From: |
Akim Demaille |
Subject: |
maint: minor changes in the test suite |
Date: |
Fri, 15 Jun 2012 15:25:47 +0200 |
These changes, installed in maint, are preparing forthcoming
changes.
From 3d8082ad27164bc0eb49af394400dbecc275e922 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Mon, 11 Jun 2012 16:43:42 +0200
Subject: [PATCH 1/2] tests: reorder.
* tests/calc.at (power): Move its definition, as a preparation for
forthcoming changes.
And space changes.
---
tests/calc.at | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/tests/calc.at b/tests/calc.at
index c504008..790c4e6 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -250,7 +250,7 @@ int yylex (]AT_LEX_FORMALS[);
%token <ival> NUM "number"
%type <ival> exp
-%nonassoc '=' /* comparison */
+%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%left NEG /* negation--unary minus */
@@ -289,6 +289,16 @@ exp:
;
%%
+static int
+power (int base, int exponent)
+{
+ int res = 1;
+ assert (0 <= exponent);
+ for (/* Niente */; exponent; --exponent)
+ res *= base;
+ return res;
+}
+
]AT_SKEL_CC_IF(
[AT_LOCATION_TYPE_IF([[
std::ostream&
@@ -334,27 +344,16 @@ AT_YYERROR_SEES_LOC_IF([
AT_LOC_FIRST_LINE, AT_LOC_FIRST_COLUMN);
if (AT_LOC_FIRST_LINE != AT_LOC_LAST_LINE)
fprintf (stderr, "-%d.%d",
- AT_LOC_LAST_LINE, AT_LOC_LAST_COLUMN - 1);
+ AT_LOC_LAST_LINE, AT_LOC_LAST_COLUMN - 1);
else if (AT_LOC_FIRST_COLUMN != AT_LOC_LAST_COLUMN - 1)
fprintf (stderr, "-%d",
- AT_LOC_LAST_COLUMN - 1);
+ AT_LOC_LAST_COLUMN - 1);
fprintf (stderr, ": ");])
fprintf (stderr, "%s\n", s);
}])[
]AT_DEFINES_IF(, [AT_CALC_LEX])[
-static int
-power (int base, int exponent)
-{
- int res = 1;
- assert (0 <= exponent);
- for (/* Niente */; exponent; --exponent)
- res *= base;
- return res;
-}
-
-
/* A C main function. */
int
main (int argc, const char **argv)
--
1.7.10.4
From 6aef2e01a4ec078fcc1b4c3aa7bedd63f14fa5fb Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Mon, 11 Jun 2012 16:45:45 +0200
Subject: [PATCH 2/2] tests: improve AT_FULL_COMPILE.
* tests/local.at: Accept a third argument.
Simplify quotation pattern.
Calls for better refactoring, but will suffice for a while.
---
tests/local.at | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/tests/local.at b/tests/local.at
index 54ac833..6efe66f 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -450,8 +450,8 @@ AT_CHECK([[test -n "$CONF_JAVA" || exit 77
AT_CHECK([[$SHELL ../../../javacomp.sh ]$1],
[[0]], [ignore], [ignore])])
-# AT_FULL_COMPILE(OUTPUT, [OTHER])
-# --------------------------------
+# AT_FULL_COMPILE(OUTPUT, [OTHER1], [OTHER2])
+# -------------------------------------------
# Compile OUTPUT.y to OUTPUT.c, OUTPUT.cc, or OUTPUT.java, and then
# compile it to OUTPUT or OUTPUT.class. If OTHER is specified, compile
# OUTPUT-OTHER.c, OUTPUT-OTHER.cc, or OUTPUT-OTHER.java to OUTPUT or
@@ -459,16 +459,27 @@ AT_CHECK([[$SHELL ../../../javacomp.sh ]$1],
# AT_SKEL_JAVA_IF.
m4_define([AT_FULL_COMPILE], [
AT_SKEL_JAVA_IF([
- AT_BISON_CHECK([[-o ]$1[.java ]$1[.y]])
- AT_JAVA_COMPILE([$1[.java]]m4_ifval($2,
- [[$1[.java ]$1[-]$2[.java]]]))
+ AT_BISON_CHECK([-o $1.java $1.y])
+ AT_JAVA_COMPILE([$1.java],
+ m4_join([ ],
+ [$1.java],
+ m4_ifval($2, [[$1-$2.java]]),
+ m4_ifval($3, [[$1-$3.java]])))
], [
AT_SKEL_CC_IF([
- AT_BISON_CHECK([[-o ]$1[.cc ]$1[.y]])
- AT_COMPILE_CXX([$1]m4_ifval($2, [, [$1[.cc ]$1[-]$2[.cc]]]))
+ AT_BISON_CHECK([-o $1.cc $1.y])
+ AT_COMPILE_CXX([$1],
+ m4_join([ ],
+ [$1.cc],
+ m4_ifval($2, [[$1-$2.cc]]),
+ m4_ifval($3, [[$1-$3.cc]])))
], [
- AT_BISON_CHECK([[-o ]$1[.c ]$1[.y]])
- AT_COMPILE([$1]m4_ifval($2, [, [$1[.c ]$1[-]$2[.c]]]))
+ AT_BISON_CHECK([-o $1.c $1.y])
+ AT_COMPILE([$1],
+ m4_join([ ],
+ [$1.c],
+ m4_ifval($2, [[$1-$2.c]]),
+ m4_ifval($3, [[$1-$3.c]])))
])
])
])
--
1.7.10.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- maint: minor changes in the test suite,
Akim Demaille <=