Annotation of parser3/tests/console/run_tests.sh, revision 1.1
1.1 ! moko 1: #!/bin/sh
! 2: # tests for what the main suite cannot set: console arguments, the config name, DOCUMENT_ROOT.
! 3: # A test is a directory NNN, the site root: parser3 is called from there.
! 4:
! 5: PARSER=`pwd`/../../src/targets/cgi/parser3
! 6:
! 7: {
! 8: cd 001
! 9: DIR=`pwd`
! 10: BDIR=$(pwd | tr / '\\') # the same with backslashes
! 11:
! 12: printf '\n=== 001 console\n'
! 13: $PARSER -f config.p page.html
! 14:
! 15: printf '\n=== 001 console, the config given as ./config.p\n'
! 16: $PARSER -f ./config.p page.html
! 17:
! 18: printf '\n=== 001 console, the config, log and file names with backslashes\n'
! 19: $PARSER -f "$BDIR\config.p" -l "$BDIR\my.log" "$BDIR\page.html"
! 20:
! 21: printf '\n=== 001 CGI without DOCUMENT_ROOT, as IIS and fcgiwrap call it\n'
! 22: env -i GATEWAY_INTERFACE=CGI/1.1 CGI_PARSER_CONFIG=./config.p REQUEST_URI=/page.html SCRIPT_NAME=/page.html PATH_INFO=/page.html PATH_TRANSLATED="$DIR/page.html" $PARSER
! 23:
! 24: printf '\n=== 001 CGI, DOCUMENT_ROOT, PATH_TRANSLATED and a relative CGI_PARSER_LOG with backslashes, the root with a trailing one\n'
! 25: env -i GATEWAY_INTERFACE=CGI/1.1 CGI_PARSER_CONFIG=./config.p CGI_PARSER_LOG="log\my.log" REQUEST_URI=/page.html SCRIPT_NAME=/page.html PATH_INFO=/page.html DOCUMENT_ROOT="$DIR\\" PATH_TRANSLATED="$DIR\page.html" $PARSER
! 26: cd ..
! 27:
! 28: cd 002
! 29: printf '\n=== 002 the config which is the /auto.p too: same path, loaded once\n'
! 30: $PARSER -f auto.p page.html
! 31:
! 32: printf '\n=== 002 the same config given as ./auto.p: loaded again as /auto.p [a known limitation]\n'
! 33: $PARSER -f ./auto.p page.html
! 34:
! 35: printf '\n=== 002 the page given as ./page.html: auto.p is loaded again as /./auto.p [a known limitation]\n'
! 36: $PARSER -f auto.p ./page.html
! 37: cd ..
! 38: } >tests.log 2>&1
! 39:
! 40: diff -u ok.log tests.log
E-mail: