/[m4]/m4/tests/others.at
ViewVC logotype

Diff of /m4/tests/others.at

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by akim, Wed Aug 29 13:14:03 2001 UTC revision 1.12 by akim, Wed Aug 29 13:14:22 2001 UTC
# Line 16  Line 16 
16  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  # 02111-1307, USA.  # 02111-1307, USA.
18    
19    AT_BANNER([Composite macros.])
20    
21    
22  ## ---------- ##  ## ---------- ##
23  ## capitalize ##  ## capitalize ##
# Line 740  AT_CLEANUP Line 742  AT_CLEANUP
742    
743    
744    
 ## --------- ##  
 ## modfreeze ##  
 ## --------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([modfreeze])  
   
 AT_DATA([[frozen.m4]],  
 [[divert(1)dnl  
 define(`test', `local::`test'')dnl  
 define(`test1', defn(`test'))dnl  
 ->test  
 load(`modtest')  
 define(`test2', defn(`test'))dnl  
 ->test  
 load(`shadow')  
 define(`test3', defn(`test'))dnl  
 ->test  
 ]])  
   
 AT_DATA([[unfrozen.m4]],  
 [[undivert(1)dnl  
 test1  
 test2  
 test3  
 ]])  
   
 # First generate the `expout' ouput by running over the sources before  
 # freezeing.  
 AT_CHECK_M4([-m load frozen.m4 unfrozen.m4], 0,  
             [stdout], [stderr])  
   
 mv stdout expout  
 mv stderr experr  
   
 # Now freeze the first source file.  
 AT_CHECK_M4([-m load -F frozen.m4f frozen.m4], 0,  
             [ignore], [ignore])  
   
 # Now rerun the original sequence, but using the frozen file.  
 AT_CHECK_M4([-R frozen.m4f unfrozen.m4], 0,  
             [expout], [experr])  
   
 AT_CLEANUP([frozen.m4f])  
   
   
   
 ## -------- ##  
 ## modpath1 ##  
 ## -------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([--module-directory: absolute path])  
   
 AT_CHECK([M4PATH=$top_srcdir m4 -M `cd $top_builddir/modules; pwd` -m load -d modules/modtest.m4], 0,  
 [[Test module loaded.  
 Test module called.  
 Dumpdef: .  
 ]],  
 [[test: <test>  
 ]])  
   
 AT_CLEANUP  
   
   
   
 ## -------- ##  
 ## modpath2 ##  
 ## -------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([modpath2])  
   
 AT_CHECK([M4PATH=$top_srcdir LTDL_LIBRARY_PATH=$top_builddir/modules m4 -m load -d modules/modtest.m4], 0,  
 [[Test module loaded.  
 Test module called.  
 Dumpdef: .  
 ]],  
 [[test: <test>  
 ]])  
   
 AT_CLEANUP  
   
   
   
 ## -------- ##  
 ## modpath3 ##  
 ## -------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([modpath3])  
   
 AT_DATA([[in]],  
 [[test  
 Dumpdef: dumpdef(`test').  
 ]])  
   
 AT_CHECK([m4 -m load -m modtest -M $top_builddir/modules -d in], 0,  
 [[Test module called.  
 Dumpdef: .  
 ]],  
 [[test: <test>  
 ]])  
   
 AT_CLEANUP  
   
   
   
 ## -------- ##  
 ## modpath4 ##  
 ## -------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([M4MODPATH: absolute path])  
   
 AT_CHECK([M4PATH=$top_srcdir M4MODPATH=`cd $top_builddir/modules; pwd` m4 -m load -d modules/modtest.m4], 0,  
 [[Test module loaded.  
 Test module called.  
 Dumpdef: .  
 ]],  
 [[test: <test>  
 ]])  
   
 AT_CLEANUP  
   
   
   
 ## ------- ##  
 ## modtest ##  
 ## ------- ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([modtest])  
   
 AT_CHECK([M4PATH=$top_srcdir m4 -M $top_builddir/modules -m load -d modules/modtest.m4], 0,  
 [[Test module loaded.  
 Test module called.  
 Dumpdef: .  
 ]],  
 [[test: <test>  
 ]])  
   
 AT_CLEANUP  
   
   
   
745  ## ----------- ##  ## ----------- ##
746  ## multiquotes ##  ## multiquotes ##
747  ## ----------- ##  ## ----------- ##
# Line 1123  AT_CLEANUP Line 979  AT_CLEANUP
979    
980    
981    
 ## ------ ##  
 ## shadow ##  
 ## ------ ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([shadow])  
   
 AT_DATA([[shadow.m4]],  
 [[# no modules loaded yet  
 test  
 shadow  
   
 # define our own macros for `test' and `shadow'  
 define(`test', `local::`test'')  
 define(`shadow', `local::`shadow'')  
 test  
 shadow  
   
 # module Shadow defines `shadow' and `test' macros  
 load(`shadow')  
 dumpdef(`test')  
 dumpdef(`shadow')  
 test  
 shadow  
   
 # save the definition of `test' from the Shadow module  
 define(`Shadow::test', defn(`test'))  
   
 # module Test also defines a `test' macro  
 load(`modtest')  
 dumpdef(`test')  
 dumpdef(`shadow')  
 test  
 shadow  
   
 # Reloading Shadow shouldn't affect anything  
 load(`shadow')  
 dumpdef(`test')  
 dumpdef(`shadow')  
 test  
 shadow  
   
 # Unloading Test will unshadow the test definition in Shadow  
 unload(`modtest')  
 dumpdef(`test')  
 dumpdef(`shadow')  
 test  
 shadow  
   
 # Unloading Shadow once has no effect (we loaded it twice)  
 unload(`shadow')  
 dumpdef(`test')  
 dumpdef(`shadow')  
 test  
 shadow  
   
 # Unloading Shadow again will revert to copying `test' and the local  
 # `shadow' macro.  
 unload(`shadow')  
 test  
 shadow  
 ]])  
   
 AT_DATA([[expout]],  
 [[# no modules loaded yet  
 test  
 shadow  
   
 # define our own macros for `test' and `shadow'  
   
   
 local::test  
 local::shadow  
   
 # module Shadow defines `shadow' and `test' macros  
 Shadow module loaded.  
   
   
 Shadow::test called.  
 Shadow::shadow called.  
   
 # save the definition of `test' from the Shadow module  
   
   
 # module Test also defines a `test' macro  
 Test module loaded.  
   
   
 Test module called.  
 Shadow::shadow called.  
   
 # Reloading Shadow shouldn't affect anything  
   
   
   
 Test module called.  
 Shadow::shadow called.  
   
 # Unloading Test will unshadow the test definition in Shadow  
   
   
   
 Shadow::test called.  
 Shadow::shadow called.  
   
 # Unloading Shadow once has no effect (we loaded it twice)  
   
   
   
 Shadow::test called.  
 Shadow::shadow called.  
   
 # Unloading Shadow again will revert to copying `test' and the local  
 # `shadow' macro.  
   
 local::test  
 local::shadow  
 ]])  
   
 AT_DATA([[experr]],  
 [[test: <test>  
 shadow: <shadow>  
 test:   <test>  
 shadow: <shadow>  
 test:   <test>  
 shadow: <shadow>  
 test:   <test>  
 shadow: <shadow>  
 test:   <test>  
 shadow: <shadow>  
 ]])  
   
 AT_CHECK_M4([-m load shadow.m4], 0,  
             [expout], [experr])  
   
 AT_CLEANUP  
   
   
   
982  ## ------------ ##  ## ------------ ##
983  ## sync-lines.  ##  ## sync-lines.  ##
984  ## ------------ ##  ## ------------ ##
# Line 1571  This is to be UNDIVERTED soon. Line 1288  This is to be UNDIVERTED soon.
1288    
1289  AT_CLEANUP  AT_CLEANUP
1290    
   
   
 ## ------ ##  
 ## unload ##  
 ## ------ ##  
 # Written by Gary V. Vaughan <gary@gnu.org>  
   
 AT_SETUP([unload])  
   
 AT_DATA([[in]],  
 [[test  
 __test__  
 load(`modtest')  
 test  
 __test__  
 load(`shadow')  
 test  
 __test__  
 unload(`modtest')  
 test  
 __test__  
 load(`modtest')  
 test  
 __test__  
 unload(`modtest')  
 test  
 __test__  
 unload(`shadow')  
 test  
 __test__  
 ]])  
   
 AT_DATA([[expout]],  
 [[test  
 __test__  
 Test module loaded.  
 Test module called.  
 modtest  
 Shadow module loaded.  
 Shadow::test called.  
 shadow  
   
 Shadow::test called.  
 shadow  
 Test module loaded.  
 Test module called.  
 modtest  
   
 Shadow::test called.  
 shadow  
   
 test  
 __test__  
 ]])  
   
 AT_CHECK_M4([-m load in], 0, expout)  
   
 AT_CLEANUP  
   
1291    
1292    
1293  ## ---- ##  ## ---- ##

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26