# # patch "ChangeLog" # from [bf2c74e888b019a03f672a3c1b3bf0cf88c2bbb6] # to [cb0e3cae3a10d96d075eb5eb8dd5e7cc4dd3e0d9] # # patch "tests/t_automate_stdio.at" # from [fad89e7d69f7e9bb1570016da9d70845c4617e65] # to [82905ef9235da9d20dc5c56e9e0b3e0a55a919d4] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,9 @@ 2005-05-25 Timothy Brownawell + * tests/t_automate_stdio.at: Make it self-contained. + +2005-05-25 Timothy Brownawell + * contrib/get_stdio.pl (new file): Perl script to parse the output from "mtn automate stdio". Used by... * tests/t_automate_stdio.at (new file): Test for "mtn automate stdio". --- tests/t_automate_stdio.at +++ tests/t_automate_stdio.at @@ -1,12 +1,36 @@ AT_SETUP([automate stdio]) MONOTONE_SETUP +AT_DATA(get_stdio.pl, [#!/usr/bin/perl +$x=""; +open $file, $ARGV[[0]]; +while(<$file>) +{ + $x = $x . $_; +} +while($x =~ /(\d+)\:\d+\:[[lm]]\:(\d+)\:/s) +{ + $m=int($2); + my $n=""; + $x = $';#' + for(;$m > 0; $m--) + { + $x =~ /(.)/s; + $n = $n . $1; + $x = $';#' + } + $results[[$1]] = $results[[$1]] . $n; +} +print $results[[$ARGV[1]]]; +]) + AT_DATA(output, [file contents ]) AT_CHECK(MONOTONE automate inventory, [], [stdout], [ignore]) AT_CHECK(mv stdout output) AT_CHECK(echo "l9:inventorye"|MONOTONE automate stdio, [], [stdout], [ignore]) -CHECK_SAME_STDOUT(../../contrib/get_stdio.pl stdout 0, cat output) +AT_CHECK(chmod u+x get_stdio.pl) +CHECK_SAME_STDOUT(./get_stdio.pl stdout 0, cat output) AT_CLEANUP