350 |
|
|
351 |
AT_CLEANUP |
AT_CLEANUP |
352 |
|
|
353 |
|
|
354 |
|
## ------------------------------------ ## |
355 |
|
## AS_REQUIRE_SHELL_FN and m4_require. ## |
356 |
|
## ------------------------------------ ## |
357 |
|
|
358 |
|
# Hypothesis: M4sh expands the requirements of AS_REQUIRE_SHELL_FN |
359 |
|
# in the main diversion, and not in M4SH-INIT. |
360 |
|
|
361 |
|
AT_SETUP([AS@&t@_REQUIRE_SHELL_FN and m4@&t@_require]) |
362 |
|
|
363 |
|
AT_DATA_M4SH([script.as], [[dnl |
364 |
|
AS_INIT |
365 |
|
|
366 |
|
m4_defun([in_m4_sh_init], still_in_m4sh_init=yes) |
367 |
|
m4_defun([not_in_m4_sh_init], still_in_m4sh_init=no) |
368 |
|
|
369 |
|
m4_defun([error_if_emitted_in_m4sh_init], [ |
370 |
|
if test x$still_in_m4sh_init = xyes; then |
371 |
|
AS_ERROR([requirement emitted in M4SH-INIT]) |
372 |
|
fi |
373 |
|
]) |
374 |
|
|
375 |
|
m4_defun([TEST_FUNC_BODY], [ |
376 |
|
m4_require([error_if_emitted_in_m4sh_init]) |
377 |
|
: echo in shell function, with parameter = [$]1 |
378 |
|
]) |
379 |
|
|
380 |
|
|
381 |
|
m4_defun([test_init], [ |
382 |
|
AS_REQUIRE([in_m4_sh_init]) |
383 |
|
AS_REQUIRE_SHELL_FN([test_func], [TEST_FUNC_BODY]) |
384 |
|
AS_REQUIRE([not_in_m4_sh_init]) |
385 |
|
]) |
386 |
|
|
387 |
|
test_init |
388 |
|
test_func parameter1 |
389 |
|
]]) |
390 |
|
|
391 |
|
AT_CHECK_M4SH |
392 |
|
AT_CHECK([./script]) |
393 |
|
|
394 |
|
AT_CLEANUP |
395 |
|
|
396 |
|
|
397 |
## -------------- ## |
## -------------- ## |
398 |
## AS_HELP_STRING ## |
## AS_HELP_STRING ## |
399 |
## -------------- ## |
## -------------- ## |