[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new autotest macro: AT_DATA_UNQUOTED
From: |
Akim Demaille |
Subject: |
Re: new autotest macro: AT_DATA_UNQUOTED |
Date: |
Mon, 13 Oct 2003 11:00:46 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
> I'd like to be able to do stuff like this:
> AT_DATA_UNQUOTED([configure.ac],
> [[AC_INIT
> AC_CONFIG_AUX_DIR([$top_srcdir/config])
> AC_OUTPUT
> ]])
> Where $top_srcdir is expanded in the generated configure.ac, otherwise
> the tools that grep for AC_CONFIG_AUX_DIR (autopoint, libtoolize)
> complain about shell variables in the argument.
I have tried hard to avoid dynamic expressions precisely in order to
enforce relocatable test cases. Your example quite demonstrates what
I meant to avoid :(. Maybe we should address a different need: some
kind of store into which the test suite creates files which are used
by most tests?
> Here is the macro:
> # AT_DATA_UNQUOTED(FILE, CONTENTS)
> # -----------------------
> # Initialize an input data FILE with given CONTENTS, which should end
> with
> # an end of line.
> # This macro is not robust to shell variable and command substitutions
> # *on purpose*. If you don't want shell substitions, use AT_DATA.
> # This macro is not robust to active symbols in CONTENTS *on purpose*.
> # If you don't want CONTENT to be evaluated, quote it twice.
> m4_define([AT_DATA_UNQUOTED],
> [cat >$1 <<_ATEOF
> $2[]_ATEOF
> ])
> Is there a better way to achieve what I need? Or shall I write a
> ChangeLog and some texi docs and commit?