[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] tests: improve titles
From: |
Akim Demaille |
Subject: |
[PATCH 3/6] tests: improve titles |
Date: |
Sun, 23 Dec 2012 10:27:03 +0100 |
* tests/local.at (AT_SETUP_STRIP): New.
(AT_SETUP): Use it to shorten the test titles: remove %defines, %language
and %skeleton whose arguments suffice.
* tests/synclines.at: Use more precise AT_SETUP.
---
tests/local.at | 22 ++++++++++++++++++++++
tests/synclines.at | 2 +-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/tests/local.at b/tests/local.at
index f7a6471..c291606 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -29,6 +29,20 @@ m4_define([m4_null_if],
[], [$2],
[$3])])
+# AT_SETUP_STRIP(TITLE)
+# ---------------------
+# Abbreviate the TITLE to be passed to AT_SETUP.
+m4_define([AT_SETUP_STRIP],
+[m4_bpatsubsts([$1],
+ [%\(language\|skeleton\) "?\([^\" ]*\)"?],
+ [\2],
+ [%define "?\([-A-Za-z0-9_.]+\)"? \("\([^\" ]+\)"\|\([-A-Za-z0-9_.]+\)\)],
+ [\1=\3\4],
+ [%define "?\([-A-Za-z0-9_.]+\)"?],
+ [\1])dnl
+])
+
+
## ------------- ##
## Basic tests. ##
## ------------- ##
@@ -887,12 +901,20 @@ m4_popdef([AT_COND_CASE])])
+
## ----------------------- ##
## Launch the test suite. ##
## ----------------------- ##
AT_INIT
+# AT_SETUP([TITLE])
+# -----------------
+# Redefine AT_SETUP to be more concise. Must be done after AT_INIT.
+m4_copy_force([AT_SETUP], [B4_SETUP])
+m4_define([AT_SETUP],
+[B4_SETUP(m4_expand([AT_SETUP_STRIP([[$1]])]))])
+
# Cannot assign CC and CFLAGS here, since atlocal is loaded after
# options are processed, so we don't know the value of CXX and
# CXXFLAGS yet.
diff --git a/tests/synclines.at b/tests/synclines.at
index 6b84719..e1fb257 100644
--- a/tests/synclines.at
+++ b/tests/synclines.at
@@ -268,7 +268,7 @@ m4_popdef([AT_TEST])
## ----------- ##
m4_pushdef([AT_TEST],
-[AT_SETUP([%no-lines])
+[AT_SETUP([%no-lines: $1])
AT_BISON_OPTION_PUSHDEFS([%skeleton "$1" %defines])
AT_DATA_GRAMMAR([input.y],
--
1.8.0.2
- [PATCH 0/6] {master} minor improvements, Akim Demaille, 2012/12/26
- [PATCH 1/6] c++: use // comments in the output, Akim Demaille, 2012/12/26
- [PATCH 4/6] skeletons: fix an error message, Akim Demaille, 2012/12/26
- [PATCH 2/6] c++: comment changes, Akim Demaille, 2012/12/26
- [PATCH 5/6] uniqstr: formatting changes, Akim Demaille, 2012/12/26
- [PATCH 3/6] tests: improve titles,
Akim Demaille <=
- [PATCH 6/6] variant: produce stable results, Akim Demaille, 2012/12/26