Changeset 70 for trunk

Show
Ignore:
Timestamp:
05/08/08 19:50:54 (8 months ago)
Author:
scott
Message:

Updated test loader and added test case for awkdoc

Location:
trunk/awkbot
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/awkbot/bin/teststrap

    r50 r70  
    11#!/bin/sh 
    22 
    3 failed=1 
     3failed=0 
     4total=0 
    45 
    56for file in t/*.awk 
    67do  
     8    total=`expr $total + 1` 
    79    tmpfile=`tempfile` 
    8     echo processing $file 
    910    # Strip comments, stolen from perl! 
    10     sed -f cpp-filter.sed $file | cpp -I src -I /usr/share/awk > $tmpfile 
    11     echo running $file 
     11    cpp -I src -I /usr/share/awk $file 2> /dev/null > $tmpfile 
     12    echo "executing test $file" 
    1213    awk -f $tmpfile 
    1314    if [ $? = 1 ] 
     
    1516        echo "$file failed" 
    1617        failed=`expr $failed + 1` 
     18    else 
     19        echo "$file passed" 
    1720    fi 
     21 
     22    # Clean up temp file 
     23    rm $tmpfile 
    1824done 
     25 
     26if [ $failed -gt 0 ] 
     27then 
     28    echo "$failed/$total tests failed" 
     29    exit 1 
     30else 
     31    echo "All tests passed" 
     32    exit 0 
     33fi 
  • trunk/awkbot/etc/awkbot.conf

    r56 r70  
    1414#    channel blacksun 
    1515    debug 1 
    16     startup PRIVMSG NickServ :identify darwin 
     16    startup PRIVMSG NickServ :identify <!-- password --> 
    1717</irc> 
    1818 
     
    2222 
    2323<mysql> 
    24     username scottmc 
    25     password scottmc 
     24    username <!-- username --> 
     25    password <!-- password --> 
    2626    database awkbot 
    2727</mysql> 
  • trunk/awkbot/src/awkdoc.awk

    r8 r70  
    44    else Func = 1 
    55 
    6     manpage = "man awk"; 
     6    manpage = "man gawk"; 
    77 
    88    Keyword = "^       " Keyword (match(Keyword,"/") ? "" :  
  • trunk/awkbot/t/irc_test.awk

    r48 r70  
    11#import <irc.awk> 
    22BEGIN { 
     3    exit(0); # skip test for now... 
    34    irc_set("debug", 1) 
    45 
    56#    irc_register("initialize") 
    67    irc_register("connect") 
    7     irc_register("privmsg") 
    88 
    9     irc_set("nickname", "awklibirc") 
     9    irc_set("nickname", "awklibirc_t") 
    1010    irc_set("realname", "Testing irc.awk") 
    1111    irc_set("username", "tag") 
     
    1717 
    1818function irc_handler_connect () { 
    19     irc_join("#awk") 
     19    exit(0); 
    2020} 
    21  
    22 function irc_handler_privmsg (message,arg) { 
    23     print message 
    24 } 
  • trunk/awkbot/t/queue_test.awk

    r48 r70  
    1818    assert((shift(queue) == 2), "4") 
    1919    assert((shift(queue) == 1), "5") 
     20 
     21    exit 0 
    2022} 
  • trunk/awkbot/t/test_config.awk

    r8 r70  
    11# deps: assert.awk awkbot_awkbot_config.awk 
     2 
     3#import <assert.awk> 
     4#import <config.awk> 
    25 
    36BEGIN { 
     
    58    config_load("t/test_config.conf") 
    69 
    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#   } 
    1013 
    1114    assert((config("Test")    == 1), "Test failed") 
     
    1316    assert((config("foo.baz") == 3), "Test failed") 
    1417 
    15     print "OKAY, Passed tests" 
    16     print "This is 3:", config("foo.baz") 
    17     exit (0) 
     18    exit 0 
    1819}