Changeset 70
- Timestamp:
- 05/08/08 19:50:54 (8 months ago)
- Location:
- trunk/awkbot
- Files:
-
- 1 added
- 6 modified
-
bin/teststrap (modified) (2 diffs)
-
etc/awkbot.conf (modified) (2 diffs)
-
src/awkdoc.awk (modified) (1 diff)
-
t/irc_test.awk (modified) (2 diffs)
-
t/queue_test.awk (modified) (1 diff)
-
t/test_awkdoc.awk (added)
-
t/test_config.awk (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/awkbot/bin/teststrap
r50 r70 1 1 #!/bin/sh 2 2 3 failed=1 3 failed=0 4 total=0 4 5 5 6 for file in t/*.awk 6 7 do 8 total=`expr $total + 1` 7 9 tmpfile=`tempfile` 8 echo processing $file9 10 # Strip comments, stolen from perl! 10 sed -f cpp-filter.sed $file | cpp -I src -I /usr/share/awk> $tmpfile11 echo running $file11 cpp -I src -I /usr/share/awk $file 2> /dev/null > $tmpfile 12 echo "executing test $file" 12 13 awk -f $tmpfile 13 14 if [ $? = 1 ] … … 15 16 echo "$file failed" 16 17 failed=`expr $failed + 1` 18 else 19 echo "$file passed" 17 20 fi 21 22 # Clean up temp file 23 rm $tmpfile 18 24 done 25 26 if [ $failed -gt 0 ] 27 then 28 echo "$failed/$total tests failed" 29 exit 1 30 else 31 echo "All tests passed" 32 exit 0 33 fi -
trunk/awkbot/etc/awkbot.conf
r56 r70 14 14 # channel blacksun 15 15 debug 1 16 startup PRIVMSG NickServ :identify darwin16 startup PRIVMSG NickServ :identify <!-- password --> 17 17 </irc> 18 18 … … 22 22 23 23 <mysql> 24 username scottmc25 password scottmc24 username <!-- username --> 25 password <!-- password --> 26 26 database awkbot 27 27 </mysql> -
trunk/awkbot/src/awkdoc.awk
r8 r70 4 4 else Func = 1 5 5 6 manpage = "man awk";6 manpage = "man gawk"; 7 7 8 8 Keyword = "^ " Keyword (match(Keyword,"/") ? "" : -
trunk/awkbot/t/irc_test.awk
r48 r70 1 1 #import <irc.awk> 2 2 BEGIN { 3 exit(0); # skip test for now... 3 4 irc_set("debug", 1) 4 5 5 6 # irc_register("initialize") 6 7 irc_register("connect") 7 irc_register("privmsg")8 8 9 irc_set("nickname", "awklibirc ")9 irc_set("nickname", "awklibirc_t") 10 10 irc_set("realname", "Testing irc.awk") 11 11 irc_set("username", "tag") … … 17 17 18 18 function irc_handler_connect () { 19 irc_join("#awk")19 exit(0); 20 20 } 21 22 function irc_handler_privmsg (message,arg) {23 print message24 } -
trunk/awkbot/t/queue_test.awk
r48 r70 18 18 assert((shift(queue) == 2), "4") 19 19 assert((shift(queue) == 1), "5") 20 21 exit 0 20 22 } -
trunk/awkbot/t/test_config.awk
r8 r70 1 1 # deps: assert.awk awkbot_awkbot_config.awk 2 3 #import <assert.awk> 4 #import <config.awk> 2 5 3 6 BEGIN { … … 5 8 config_load("t/test_config.conf") 6 9 7 for (key in _config) {8 print gensub(SUBSEP, ".", "g", key) ":", awkbot_config[key]9 }10 # for (key in _config) { 11 # print gensub(SUBSEP, ".", "g", key) ":", awkbot_config[key] 12 # } 10 13 11 14 assert((config("Test") == 1), "Test failed") … … 13 16 assert((config("foo.baz") == 3), "Test failed") 14 17 15 print "OKAY, Passed tests" 16 print "This is 3:", config("foo.baz") 17 exit (0) 18 exit 0 18 19 }