diff options
Diffstat (limited to 'modules/core/test/conf')
71 files changed, 822 insertions, 0 deletions
diff --git a/modules/core/test/conf/inc63_1.conf b/modules/core/test/conf/inc63_1.conf new file mode 100644 index 0000000..6a436f9 --- /dev/null +++ b/modules/core/test/conf/inc63_1.conf @@ -0,0 +1,5 @@ +# macro for include +<Macro Foo $where> + Warning "Foo macro at $where" +</Macro> +Use Foo "inc63_.conf:5" diff --git a/modules/core/test/conf/inc63_2.conf b/modules/core/test/conf/inc63_2.conf new file mode 100644 index 0000000..3a0da9e --- /dev/null +++ b/modules/core/test/conf/inc63_2.conf @@ -0,0 +1,3 @@ +# use macro defined elsewhere +Use Foo "inc63_2.conf:2" +Use Bla "inc63_2.conf:3" diff --git a/modules/core/test/conf/test01.conf b/modules/core/test/conf/test01.conf new file mode 100644 index 0000000..9a3d9ab --- /dev/null +++ b/modules/core/test/conf/test01.conf @@ -0,0 +1,3 @@ +# no macro name +<Macro> +</Macro> diff --git a/modules/core/test/conf/test02.conf b/modules/core/test/conf/test02.conf new file mode 100644 index 0000000..1fe4b41 --- /dev/null +++ b/modules/core/test/conf/test02.conf @@ -0,0 +1,3 @@ +# no macro name and spaces +<Macro > +</Macro> diff --git a/modules/core/test/conf/test03.conf b/modules/core/test/conf/test03.conf new file mode 100644 index 0000000..fdcf4c8 --- /dev/null +++ b/modules/core/test/conf/test03.conf @@ -0,0 +1,5 @@ +# use undefined macro +<Macro foo> + Warning "macro foo" +</Macro> +Use bla diff --git a/modules/core/test/conf/test04.conf b/modules/core/test/conf/test04.conf new file mode 100644 index 0000000..8228775 --- /dev/null +++ b/modules/core/test/conf/test04.conf @@ -0,0 +1,5 @@ +# wrong args +<Macro foo> + Warning "macro foo" +</Macro> +Use foo hello diff --git a/modules/core/test/conf/test05.conf b/modules/core/test/conf/test05.conf new file mode 100644 index 0000000..2166aca --- /dev/null +++ b/modules/core/test/conf/test05.conf @@ -0,0 +1,5 @@ +# wrong args +<Macro foo $premier> + Warning "macro foo $premier" +</Macro> +Use foo diff --git a/modules/core/test/conf/test06.conf b/modules/core/test/conf/test06.conf new file mode 100644 index 0000000..35e6b68 --- /dev/null +++ b/modules/core/test/conf/test06.conf @@ -0,0 +1,6 @@ +# wrong args +<Macro foo $premier> + Warning "macro foo $premier" +</Macro> +Use foo one two + diff --git a/modules/core/test/conf/test07.conf b/modules/core/test/conf/test07.conf new file mode 100644 index 0000000..06f050e --- /dev/null +++ b/modules/core/test/conf/test07.conf @@ -0,0 +1,3 @@ +# missing end macro +<Macro foo $premier> +hello diff --git a/modules/core/test/conf/test08.conf b/modules/core/test/conf/test08.conf new file mode 100644 index 0000000..333dbd9 --- /dev/null +++ b/modules/core/test/conf/test08.conf @@ -0,0 +1,3 @@ +# missing begin macro +ServerName hello +</Macro> diff --git a/modules/core/test/conf/test09.conf b/modules/core/test/conf/test09.conf new file mode 100644 index 0000000..2513b6e --- /dev/null +++ b/modules/core/test/conf/test09.conf @@ -0,0 +1,6 @@ +# recursion is bad +<Macro foo> +Use foo +</Macro> + +Use foo diff --git a/modules/core/test/conf/test10.conf b/modules/core/test/conf/test10.conf new file mode 100644 index 0000000..157129d --- /dev/null +++ b/modules/core/test/conf/test10.conf @@ -0,0 +1,10 @@ +# indirect recursion is bad +<Macro foo> +Use bla +</Macro> + +<Macro bla> +Use foo +</Macro> + +Use foo diff --git a/modules/core/test/conf/test11.conf b/modules/core/test/conf/test11.conf new file mode 100644 index 0000000..f397ec6 --- /dev/null +++ b/modules/core/test/conf/test11.conf @@ -0,0 +1,15 @@ +# inner macros... +<Macro foo $arg> +<Macro $arg.in> +Warning "macro $arg.in line 1" +</Macro> +</Macro> + +# generate a one.in macro +Use foo one + +# use it! +Use one.in + +# end processing +Error "done line 15." diff --git a/modules/core/test/conf/test12.conf b/modules/core/test/conf/test12.conf new file mode 100644 index 0000000..84403c6 --- /dev/null +++ b/modules/core/test/conf/test12.conf @@ -0,0 +1,12 @@ +# multiply defined generates a warning +<Macro foo> + Warning "macro foo 1, line 1" +</Macro> + +<Macro foo> + Warning "macro foo 2, line 1" +</Macro> + +Use foo + +Error "done line 12." diff --git a/modules/core/test/conf/test13.conf b/modules/core/test/conf/test13.conf new file mode 100644 index 0000000..244470d --- /dev/null +++ b/modules/core/test/conf/test13.conf @@ -0,0 +1,18 @@ +# case insensitive +<Macro FOO> + Warning "macro FOO line 1" +</MACRO> + +<MACRO bla> + Warning "macro bla line 1" +</macro> + +use foo + +<macro foo> + Warning "redefined macro foo line 1" +</macro> + +use FOO + +Error "done line 18." diff --git a/modules/core/test/conf/test14.conf b/modules/core/test/conf/test14.conf new file mode 100644 index 0000000..48d8888 --- /dev/null +++ b/modules/core/test/conf/test14.conf @@ -0,0 +1,23 @@ +# VirtualHost example + +<Macro MyVirtualHost $host $port $dir> + Listen $port + <VirtualHost $host:$port> + DocumentRoot $dir + <Directory $dir> + Warning "directory $dir" + </Directory> + # limit access to intranet subdir. + <Directory $dir/intranet> + Warning "directory $dir/intranet" + </Directory> + </VirtualHost> +</Macro> + +Use MyVirtualHost www.apache.org 80 /projects/apache/web + +Use MyVirtualHost www.perl.com 8080 /projects/perl/web + +Use MyVirtualHost www.ensmp.fr 1234 /projects/mines/web + +Error "done line 23." diff --git a/modules/core/test/conf/test15.conf b/modules/core/test/conf/test15.conf new file mode 100644 index 0000000..7990e15 --- /dev/null +++ b/modules/core/test/conf/test15.conf @@ -0,0 +1,9 @@ +# non nested... +<macro test> +<directory /tmp> +</macro> + +use test +</directory> + +Error should not reach this point. diff --git a/modules/core/test/conf/test16.conf b/modules/core/test/conf/test16.conf new file mode 100644 index 0000000..471f66e --- /dev/null +++ b/modules/core/test/conf/test16.conf @@ -0,0 +1,11 @@ +# bad nesting + +<Macro foo> +</Limit> +</Macro> + +<Limit GET> +Use foo +</Limit> + +stop diff --git a/modules/core/test/conf/test17.conf b/modules/core/test/conf/test17.conf new file mode 100644 index 0000000..f6294bb --- /dev/null +++ b/modules/core/test/conf/test17.conf @@ -0,0 +1,10 @@ +# bad but good nesting + +<Macro foo> +</Directory> +</Macro> + +<Directory /tmp> +Use foo + +Error "done on line 10." diff --git a/modules/core/test/conf/test18.conf b/modules/core/test/conf/test18.conf new file mode 100644 index 0000000..118617d --- /dev/null +++ b/modules/core/test/conf/test18.conf @@ -0,0 +1,10 @@ +# bad but good nesting + +<Macro foo> +</Location> +</Macro> + +<Location /intranet> +Use foo + +Error "done on line 10." diff --git a/modules/core/test/conf/test19.conf b/modules/core/test/conf/test19.conf new file mode 100644 index 0000000..6568e96 --- /dev/null +++ b/modules/core/test/conf/test19.conf @@ -0,0 +1,26 @@ +# okay till done + +<Macro foo $where> + # something + Warning "macro foo line 2 in $where" +</Macro> + +<Directory /tmp> + Use foo Directory +</Directory> + +<Location /intra> + Use foo Location +</Location> + +<VirtualHost www.apache.org> + Use foo VirtualHost +</VirtualHost> + +<VirtualHost www.perl.com> + <Directory /tmp> + Use foo "VirtualHost & Directory" + </Directory> +</VirtualHost> + +Error "done line 26." diff --git a/modules/core/test/conf/test20.conf b/modules/core/test/conf/test20.conf new file mode 100644 index 0000000..ccbae0d --- /dev/null +++ b/modules/core/test/conf/test20.conf @@ -0,0 +1,11 @@ +# directory in directory through a macro + +<Macro foo $dir> + <Directory $dir> + Warning "macro foo $dir" + </Directory> +</Macro> + +<Directory /tmp> + Use foo /tmp +</Directory> diff --git a/modules/core/test/conf/test21.conf b/modules/core/test/conf/test21.conf new file mode 100644 index 0000000..7a8c4c9 --- /dev/null +++ b/modules/core/test/conf/test21.conf @@ -0,0 +1,11 @@ +# raise an error + +<Macro foo> + <Directory /tmp> + Error "macro foo dir /tmp" + </Directory> +</Macro> + +<VirtualHost *> + Use foo +</VirtualHost> diff --git a/modules/core/test/conf/test22.conf b/modules/core/test/conf/test22.conf new file mode 100644 index 0000000..5a89f83 --- /dev/null +++ b/modules/core/test/conf/test22.conf @@ -0,0 +1,11 @@ +# simple nesting + +<Macro foo> + <Directory /tmp> + Warning "macro foo" + </Directory> +</Macro> + +Use foo + +Error "done on line 11." diff --git a/modules/core/test/conf/test23.conf b/modules/core/test/conf/test23.conf new file mode 100644 index 0000000..e21e2ee --- /dev/null +++ b/modules/core/test/conf/test23.conf @@ -0,0 +1,15 @@ +# macro defined in a directory + +<Directory /tmp> + <Macro foo> + Warning "macro foo in /tmp" + </Macro> +</Directory> + +Use foo + +<Directory /tmp> + Use foo +</Directory> + +Error "done!" diff --git a/modules/core/test/conf/test24.conf b/modules/core/test/conf/test24.conf new file mode 100644 index 0000000..d35070e --- /dev/null +++ b/modules/core/test/conf/test24.conf @@ -0,0 +1,23 @@ +# nesting... + +<Macro bla> + <Location /intra> + Warning "macro bla intra" + </Location> + <Location /private> + Warning "macro bla private" + </Location> +</Macro> + +# ok location in config +Use bla + +# ok, location in VH +<VirtualHost foo.com> + Use bla +</VirtualHost> + +<Directory /tmp> + # fails: Location within an Directory + Use bla +</Directory> diff --git a/modules/core/test/conf/test25.conf b/modules/core/test/conf/test25.conf new file mode 100644 index 0000000..724cf94 --- /dev/null +++ b/modules/core/test/conf/test25.conf @@ -0,0 +1,27 @@ +# ok till stop. + +<Macro RestrictedAccessPolicy $ips> + Warning "restricted access policy $ips" +</Macro> + +<Directory /unexpected/1> + Use RestrictedAccessPolicy 10.0.0.0/8 +</Directory> + +<Macro LocalAccessOnly> + Use RestrictedAccessPolicy 10.0.0.0/8 +</Macro> + +<Directory /unexpected/2> + Use RestrictedAccessPolicy "192.54.172.0/24 192.54.148.0/24 10.0.0.0/8" +</Directory> + +<Location /intra> + Use LocalAccessOnly +</Location> + +<Location /admin> + Use LocalAccessOnly +</Location> + +Error "done line 27." diff --git a/modules/core/test/conf/test26.conf b/modules/core/test/conf/test26.conf new file mode 100644 index 0000000..bb4b5ad --- /dev/null +++ b/modules/core/test/conf/test26.conf @@ -0,0 +1,19 @@ +# ok till stop. +# test quotes... + +<Macro funny "first arg" 'second ... arg'> + <Directory first arg> + Warning "funny directory" + </Directory> + <Location second ... arg> + Warning "funny location" + </Location> +</Macro> + +Use funny /unexpected/1 /intra + +<VirtualHost www.apache.org> + Use funny /unexpected/2 /intranet +</VirtualHost> + +Error "done!" diff --git a/modules/core/test/conf/test27.conf b/modules/core/test/conf/test27.conf new file mode 100644 index 0000000..2f3e83c --- /dev/null +++ b/modules/core/test/conf/test27.conf @@ -0,0 +1,22 @@ +# define a macro in a macro. + +<Macro foo $dir $name> + <Macro foo.$name> + <Directory $dir> + Warning "foo.$name $dir" + </Directory> + </Macro> +</Macro> + +Use foo /unexpected/1 one +Use foo /unexpected/2 two + +Use foo.one +Use foo.two +Use foo.one + +UndefMacro foo.one +UndefMacro foo.two +UndefMacro foo + +Error "done!" diff --git a/modules/core/test/conf/test28.conf b/modules/core/test/conf/test28.conf new file mode 100644 index 0000000..69c1c9b --- /dev/null +++ b/modules/core/test/conf/test28.conf @@ -0,0 +1,13 @@ +# interaction with IfModule + +<IfModule mod_macro.c> + <Macro foo> + Warning "macro foo" + </Macro> + + Use foo + + Error "done!" +</IfModule> + +Error "should not get there" diff --git a/modules/core/test/conf/test29.conf b/modules/core/test/conf/test29.conf new file mode 100644 index 0000000..7d1f380 --- /dev/null +++ b/modules/core/test/conf/test29.conf @@ -0,0 +1,10 @@ +# trigger line overflow during expansion + +<Macro toobigaline a> + Warning aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +</Macro> + +Use toobigaline "cette ligne va etre vraiment trop longue ya pas de doute" + +Error "should not get there!" diff --git a/modules/core/test/conf/test30.conf b/modules/core/test/conf/test30.conf new file mode 100644 index 0000000..72b2bb2 --- /dev/null +++ b/modules/core/test/conf/test30.conf @@ -0,0 +1,12 @@ +# name conficts: the longest is chosen +# also test a parametric section + +<Macro foo $dir $directive> + <$directive $dir> + Warning "section $directive $dir" + </$directive> +</Macro> + +Use foo /unexpected/1 Directory + +Error "done!" diff --git a/modules/core/test/conf/test31.conf b/modules/core/test/conf/test31.conf new file mode 100644 index 0000000..14964ba --- /dev/null +++ b/modules/core/test/conf/test31.conf @@ -0,0 +1,16 @@ +# parameter name conflicts + +<Macro bla $dir $di $dd $d> + Warning "argument name conflicts" + $d $di $dir $dd +</Macro> + +Use bla '' '' 8080 Listen + +<Macro foo $d $di $dir $dd> + Warning "conflicts, but arguments are not used" +</Macro> + +Use foo '' '' 8080 Listen + +Error "done on line 16." diff --git a/modules/core/test/conf/test32.conf b/modules/core/test/conf/test32.conf new file mode 100644 index 0000000..0b116ec --- /dev/null +++ b/modules/core/test/conf/test32.conf @@ -0,0 +1,7 @@ +# error if same argument name. + +<Macro foo $arg1 $arg2 $arg3 $arg2> +# bad +</Macro> + + diff --git a/modules/core/test/conf/test33.conf b/modules/core/test/conf/test33.conf new file mode 100644 index 0000000..2a8a6db --- /dev/null +++ b/modules/core/test/conf/test33.conf @@ -0,0 +1,3 @@ +# empty name. + +Use '' diff --git a/modules/core/test/conf/test34.conf b/modules/core/test/conf/test34.conf new file mode 100644 index 0000000..1f4671f --- /dev/null +++ b/modules/core/test/conf/test34.conf @@ -0,0 +1,14 @@ +# macro parameter prefix conflicts in two orders + +<Macro foo $d $dd> + Warning "macro foo conflict one" +</Macro> + +<Macro bla $dd $d> + Warning "macro bla conflict two" +</Macro> + +Use foo 1 2 +Use bla 1 2 + +Error "done on line 14." diff --git a/modules/core/test/conf/test35.conf b/modules/core/test/conf/test35.conf new file mode 100644 index 0000000..37a623e --- /dev/null +++ b/modules/core/test/conf/test35.conf @@ -0,0 +1,10 @@ +# unused arguments + +<Macro warnings u1 u2 n1 n2 u3> + Warning "macro cannot be used just within a comment u1 u2 u3" + # n1 n2 +</Macro> + +Use warnings 1 2 3 4 5 + +Error "done on line 10." diff --git a/modules/core/test/conf/test36.conf b/modules/core/test/conf/test36.conf new file mode 100644 index 0000000..a68667e --- /dev/null +++ b/modules/core/test/conf/test36.conf @@ -0,0 +1,12 @@ +<Macro warnings $u $n $u1 $n1 $u2 $n2> + Warning "many warnings! $u $u1 $u2" + # $n $n1 $n2 +</Macro> + +# warn about unused arguments +Use warnings 1 2 3 4 5 6 + +# may warn about empty arguments? +Use warnings '' '' '' '' '' '' + +Error "done!" diff --git a/modules/core/test/conf/test37.conf b/modules/core/test/conf/test37.conf new file mode 100644 index 0000000..296dde7 --- /dev/null +++ b/modules/core/test/conf/test37.conf @@ -0,0 +1,7 @@ +# empty argument name + +<Macro stupid ''> + Warn "macro stupid" +</Macro> + +Use stupid hello diff --git a/modules/core/test/conf/test38.conf b/modules/core/test/conf/test38.conf new file mode 100644 index 0000000..184763f --- /dev/null +++ b/modules/core/test/conf/test38.conf @@ -0,0 +1,10 @@ +# ifmodule + +<IfModule mod_macro.c> +Warning it is really a good idea to have mod_macro.c installed. +</IfModule> + +<IfModule !mod_perl.c> +Error it seems you do not have mod perl installed. +</IfModule> + diff --git a/modules/core/test/conf/test39.conf b/modules/core/test/conf/test39.conf new file mode 100644 index 0000000..792232f --- /dev/null +++ b/modules/core/test/conf/test39.conf @@ -0,0 +1,23 @@ +# okay till stop. + +<IfModule mod_macro.c> + <Macro ModMacro> + Warning Thanks for using mod_macro! + </Macro> +</IfModule> + +<IfModule !mod_macro.c> + <Macro ModMacro> + Error Sorry, mod_macro must be installed to run this configuration file. + </Macro> +</IfModule> + +Use ModMacro + +<Macro foo> + Warning "macro foo" +</Macro> + +Use foo + +Error "done!" diff --git a/modules/core/test/conf/test40.conf b/modules/core/test/conf/test40.conf new file mode 100644 index 0000000..e6b81f7 --- /dev/null +++ b/modules/core/test/conf/test40.conf @@ -0,0 +1,33 @@ +# configuration example with mod_macro +# + +<VirtualHost www.foo.com> + DocumentRoot /foo/document/root/directory + + <Macro SubDirAccessControl $subdir> + # access control to subdirs... + <Location /$subdir> + Warning "location /$subdir" + </Location> + </Macro> + + # repeat uses + Use SubDirAccessControl A + Use SubDirAccessControl B + Use SubDirAccessControl C + Use SubDirAccessControl D + Use SubDirAccessControl E + Use SubDirAccessControl G + Use SubDirAccessControl H + Use SubDirAccessControl J + Use SubDirAccessControl K + Use SubDirAccessControl L + Use SubDirAccessControl M + Use SubDirAccessControl N + + # cleanup + UndefMacro SubDirAccessControl + +</VirtualHost> + +Error Stop configuration file processing. diff --git a/modules/core/test/conf/test41.conf b/modules/core/test/conf/test41.conf new file mode 100644 index 0000000..c4e6bdb --- /dev/null +++ b/modules/core/test/conf/test41.conf @@ -0,0 +1,20 @@ +# another configuration example without mod_macro + +<VirtualHost www.foo.com> + DocumentRoot /foo/document/root/directory + + <Location /A> + Warning "location /A" + </Location> + + <Location /B> + Warning "location /B" + </Location> + + <Location /C> + Warning "location /C" + </Location> + +</VirtualHost> + +Error Stop configuration file processing. diff --git a/modules/core/test/conf/test42.conf b/modules/core/test/conf/test42.conf new file mode 100644 index 0000000..a142604 --- /dev/null +++ b/modules/core/test/conf/test42.conf @@ -0,0 +1,13 @@ +# multiple macro uses + +<Macro foo $p> + Warning "macro foo $p" +</Macro> + +Use foo '' +Use foo '' +Use foo '' +Use foo '' +Use foo '' + +Error "done on line 13." diff --git a/modules/core/test/conf/test43.conf b/modules/core/test/conf/test43.conf new file mode 100644 index 0000000..264b916 --- /dev/null +++ b/modules/core/test/conf/test43.conf @@ -0,0 +1,29 @@ +# non necessarily nested. + +<Macro begindir $dir> +<Directory $dir> +# hello +</Macro> + +<Macro enddir> +</Directory> +</Macro> + +Use begindir /unexpected/1 +Use enddir + + +Use begindir /unexpected/2 +Use enddir + +Use begindir /unexpected/3 +<Limit GET> +</Limit> +Use enddir + +<VirtualHost foo.com> +Use begindir /unexpected/4 +Use enddir +</VirtualHost> + +Error ok! diff --git a/modules/core/test/conf/test44.conf b/modules/core/test/conf/test44.conf new file mode 100644 index 0000000..ef4883e --- /dev/null +++ b/modules/core/test/conf/test44.conf @@ -0,0 +1,19 @@ +# working recursion... + +<Macro foo> +use bla +</Macro> + +<Macro bla> +<IfDefine NoFoo> +use foo +</IfDefine> +</Macro> + + +<IfDefine !NoFoo> +# foo gonna call bla, bla wont call foo back... +use foo +</IfDefine> + +Error okay. diff --git a/modules/core/test/conf/test45.conf b/modules/core/test/conf/test45.conf new file mode 100644 index 0000000..0394935 --- /dev/null +++ b/modules/core/test/conf/test45.conf @@ -0,0 +1,7 @@ +# strange chars + +<Macro warnings $1 %2 &3 @4 #5 ~6 *7 .8 ,9 !a -b +c =d :e ;f ?g> +# hello $1 %2 &3 @4 #5 ~6 *7 .8 ,9 !a -b +c =d :e ;f ?g +</Macro> + +Error "done on line 7." diff --git a/modules/core/test/conf/test46.conf b/modules/core/test/conf/test46.conf new file mode 100644 index 0000000..50520ed --- /dev/null +++ b/modules/core/test/conf/test46.conf @@ -0,0 +1,11 @@ +# various working prefixes + +<Macro $i %j @k> +# hello %j @k +</Macro> + +<Macro warnings $i second> +# not used. +</Macro> + +Error okay. diff --git a/modules/core/test/conf/test47.conf b/modules/core/test/conf/test47.conf new file mode 100644 index 0000000..6e73664 --- /dev/null +++ b/modules/core/test/conf/test47.conf @@ -0,0 +1,15 @@ +# empty macro contents... + +<Macro foo> +</Macro> + +Use foo + +<Macro bla $i> +</Macro> + +<Macro bof $i> +# some contents... +</Macro> + +Error okay. diff --git a/modules/core/test/conf/test48.conf b/modules/core/test/conf/test48.conf new file mode 100644 index 0000000..96bf461 --- /dev/null +++ b/modules/core/test/conf/test48.conf @@ -0,0 +1,23 @@ +# test substitution... + +<Macro M %premier> +Warning %premier +</Macro> + +Use M 1 +Use M 12 +Use M 123 +Use M 1234 +Use M 12345 +Use M 123456 +Use M 1234567 +Use M 12345678 +Use M 123456789 +Use M 1234567890 +Use M 1234567890a +Use M 1234567890ab +Use M 1234567890abc +Use M 1234567890abcd +Use M 1234567890abcde + +Error "done line 23." diff --git a/modules/core/test/conf/test49.conf b/modules/core/test/conf/test49.conf new file mode 100644 index 0000000..7a21c82 --- /dev/null +++ b/modules/core/test/conf/test49.conf @@ -0,0 +1,2 @@ +# undef macro before anything +UndefMacro foo diff --git a/modules/core/test/conf/test50.conf b/modules/core/test/conf/test50.conf new file mode 100644 index 0000000..33dd359 --- /dev/null +++ b/modules/core/test/conf/test50.conf @@ -0,0 +1,5 @@ +# undef non existing macro +<Macro foo> + Warning "foo macro" +</Macro> +UndefMacro bla diff --git a/modules/core/test/conf/test51.conf b/modules/core/test/conf/test51.conf new file mode 100644 index 0000000..50214fa --- /dev/null +++ b/modules/core/test/conf/test51.conf @@ -0,0 +1,9 @@ +# undef existing macro, and try to use it +<Macro foo> + Warning "foo macro contents" +</Macro> +# expanded, but will not be processed because of error +Use foo +UndefMacro foo +# error, does not exist anymore +Use foo diff --git a/modules/core/test/conf/test52.conf b/modules/core/test/conf/test52.conf new file mode 100644 index 0000000..bb77c73 --- /dev/null +++ b/modules/core/test/conf/test52.conf @@ -0,0 +1,8 @@ +# undef existing macro, and try to use it +<Macro foo> + Warning "foo macro contents line 1" +</Macro> +Use foo +UndefMacro foo + +Error "done line 8." diff --git a/modules/core/test/conf/test53.conf b/modules/core/test/conf/test53.conf new file mode 100644 index 0000000..08e8c98 --- /dev/null +++ b/modules/core/test/conf/test53.conf @@ -0,0 +1,2 @@ +# use undefined macro without prior definition +Use bla diff --git a/modules/core/test/conf/test54.conf b/modules/core/test/conf/test54.conf new file mode 100644 index 0000000..7dd30ac --- /dev/null +++ b/modules/core/test/conf/test54.conf @@ -0,0 +1,6 @@ +# empty macro +<Macro foo> +</Macro> +Use foo + +Error "done line 6." diff --git a/modules/core/test/conf/test55.conf b/modules/core/test/conf/test55.conf new file mode 100644 index 0000000..bd978e9 --- /dev/null +++ b/modules/core/test/conf/test55.conf @@ -0,0 +1,11 @@ +# line numbers... +<Macro foo $where> + Warning "macro foo(:2) line 1 ($where)" +</Macro> +<Macro bla $where> + Warning "macro bla(:5) line 1 ($where)" + Use foo "bla line 2" +</Macro> +Use foo "file line 9" +Use bla "file line 10" +Error "done line 11." diff --git a/modules/core/test/conf/test56.conf b/modules/core/test/conf/test56.conf new file mode 100644 index 0000000..b7366a2 --- /dev/null +++ b/modules/core/test/conf/test56.conf @@ -0,0 +1,18 @@ +# nesting warnings +<Macro Open $dir> + <Directory $dir> + Warning "Open:2 $dir" +</Macro> +<Macro Close> + Warning "Close:1" + </Directory> +</Macro> + +# some uses +Use Open /tmp +Use Close + +Use Open /etc +Use Close + +Error "done line 18." diff --git a/modules/core/test/conf/test57.conf b/modules/core/test/conf/test57.conf new file mode 100644 index 0000000..7c36868 --- /dev/null +++ b/modules/core/test/conf/test57.conf @@ -0,0 +1,4 @@ +# empty argument name +<Macro foo $x ''> + Warning "macro foo line 1" +</Macro> diff --git a/modules/core/test/conf/test58.conf b/modules/core/test/conf/test58.conf new file mode 100644 index 0000000..6c8a2eb --- /dev/null +++ b/modules/core/test/conf/test58.conf @@ -0,0 +1,4 @@ +# bad directive closing +<Macro foo + Warning "macro foo line 1" +</Macro> diff --git a/modules/core/test/conf/test59.conf b/modules/core/test/conf/test59.conf new file mode 100644 index 0000000..9f43d7d --- /dev/null +++ b/modules/core/test/conf/test59.conf @@ -0,0 +1,4 @@ +# empty name +<Macro ''> + Warning "empty quoted name macro" +</Macro> diff --git a/modules/core/test/conf/test60.conf b/modules/core/test/conf/test60.conf new file mode 100644 index 0000000..969a4eb --- /dev/null +++ b/modules/core/test/conf/test60.conf @@ -0,0 +1,17 @@ +# @ escaping +<Macro Foo $one $two> + Warning "macro Foo arg 1: $one" + Warning "macro Foo arg 2: $two" +</Macro> +<Macro Bla @first @second> + Warning Macro Bla arg 1: @first + Warning Macro Bla arg 2: @second + Use Foo @first 'second' + Use Foo 'first' @second + Use Foo @first @second +</Macro> + +Use Foo hello world +Use Bla "hello world" "thank you" + +Error "done on line 17." diff --git a/modules/core/test/conf/test61.conf b/modules/core/test/conf/test61.conf new file mode 100644 index 0000000..cd28597 --- /dev/null +++ b/modules/core/test/conf/test61.conf @@ -0,0 +1,18 @@ +# deep expansion +<Macro F1 $x> + Warning "F1:1 x=$x" +</Macro> +<Macro F2 $x> + Warning "F2:1 x=$x" + Use F1 $x +</Macro> +<Macro F3 $x> + Warning "F3:1 x=$x" + Use F2 $x +</Macro> +<Macro F4 $x> + Warning "F4:1 x=$x" + Use F3 $x +</Macro> +Use F4 "line=17" +Error "done line 18." diff --git a/modules/core/test/conf/test62.conf b/modules/core/test/conf/test62.conf new file mode 100644 index 0000000..9d611de --- /dev/null +++ b/modules/core/test/conf/test62.conf @@ -0,0 +1,25 @@ +# test continuations +<Macro Line \ + $start \ + $stop> + Warning \ + "Line:1-2 start at $start" + Warning \ + "Line:3-4 stop at $stop" +</Macro> + +Use Line 11 11 +Use Line \ + 12 13 +Use Line \ + 14 \ + 16 +Use Line 17 \ + 18 +Use Line \ + \ + 19 \ + \ + 23 + +Error "done line 25." diff --git a/modules/core/test/conf/test63.conf b/modules/core/test/conf/test63.conf new file mode 100644 index 0000000..7988ae4 --- /dev/null +++ b/modules/core/test/conf/test63.conf @@ -0,0 +1,9 @@ +# include +include ${PWD}/inc63_1.conf +Use Foo "test63.conf:3" +<Macro Bla $where> + Warning "Bla at $where" +</Macro> +include ${PWD}/inc63_2.conf +Use Bla "test63.conf:8" +Error "done at line 9." diff --git a/modules/core/test/conf/test64.conf b/modules/core/test/conf/test64.conf new file mode 100644 index 0000000..6c12328 --- /dev/null +++ b/modules/core/test/conf/test64.conf @@ -0,0 +1,5 @@ +# just continuations +Warning "on line 2" +Warning \ + "from line 3 to line 4" +Error "done on line 5." diff --git a/modules/core/test/conf/test65.conf b/modules/core/test/conf/test65.conf new file mode 100644 index 0000000..df9adc3 --- /dev/null +++ b/modules/core/test/conf/test65.conf @@ -0,0 +1,11 @@ +# simple use continuation +<Macro Line $line> + # first macro line is a comment + Warning "Line: $line" +</Macro> +Use Line \ + "on line 6-7" +Use \ + Line \ + "on line 8-10" +Error "done on line 11." diff --git a/modules/core/test/conf/test66.conf b/modules/core/test/conf/test66.conf new file mode 100644 index 0000000..a14e587 --- /dev/null +++ b/modules/core/test/conf/test66.conf @@ -0,0 +1,7 @@ +# no double substitution +<Macro Foo $x $y> + Warning "Foo: x=$x y=$y" +</Macro> +Use Foo X Y +Use Foo "$y" "$x" +Error "done on line 7." diff --git a/modules/core/test/conf/test67.conf b/modules/core/test/conf/test67.conf new file mode 100644 index 0000000..04a5d3d --- /dev/null +++ b/modules/core/test/conf/test67.conf @@ -0,0 +1 @@ +Error "done at line 1 without LF."
\ No newline at end of file diff --git a/modules/core/test/conf/test68.conf b/modules/core/test/conf/test68.conf new file mode 100644 index 0000000..2a7b85b --- /dev/null +++ b/modules/core/test/conf/test68.conf @@ -0,0 +1,5 @@ +# two directives with continuations & no eol at eof +Warning \ + "line 2-3" +Error \ + "done on line 4-5."
\ No newline at end of file diff --git a/modules/core/test/conf/test69.conf b/modules/core/test/conf/test69.conf new file mode 100644 index 0000000..11a0830 --- /dev/null +++ b/modules/core/test/conf/test69.conf @@ -0,0 +1,14 @@ +# warn if ignored non-blank stuff after closing '>' +<Macro Foo> this stuff is ignored... + Warning "Foo" +</Macro> this stuff is ignored as well... +Use Foo +<Macro Bla> + Warning "Bla" +</Macro> +Use Bla +<Macro Comments> # comments are fine + Warning "Comments" +</Macro> # comments are fine +Use Comments +Error "done on line 14." |