# # add_file "contrib/get_stdio.pl" # # add_file "tests/t_automate_stdio.at" # # patch ".mt-attrs" # from [681cbed450207eb0e280d82830ac66e78ec97183] # to [b4c4b693c754f78c28d144292a0d0df06faa62f8] # # patch "ChangeLog" # from [7be1fad3755ff736a7a04f9033b3d8b8cc6a25f9] # to [bf2c74e888b019a03f672a3c1b3bf0cf88c2bbb6] # # patch "contrib/get_stdio.pl" # from [] # to [6bf6efac0e90644da8338ee03e289a6d0f184278] # # patch "tests/t_automate_stdio.at" # from [] # to [fad89e7d69f7e9bb1570016da9d70845c4617e65] # # patch "testsuite.at" # from [e74ce9617d734928e0ad7c3edcfad484003f756c] # to [63d932e7386deef0a18a2723c847f8628e0737c1] # --- .mt-attrs +++ .mt-attrs @@ -1,6 +1,9 @@ file "contrib/ciabot_monotone.py" execute "true" + file "contrib/get_stdio.pl" +execute "true" + file "contrib/monoprof.sh" execute "true" --- ChangeLog +++ ChangeLog @@ -1,5 +1,12 @@ 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". + * testsuite.at: Add it. + +2005-05-25 Timothy Brownawell + * automate.cc ("automate stdio"): Fix block size limiting. Honor "output.flush()" in commands. --- contrib/get_stdio.pl +++ contrib/get_stdio.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl +#Timothy Brownawell + +#get_stdio.pl filename n +#Get the output from command n as one piece +#filename holds the output from "monotone automate stdio" + +$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]]; --- tests/t_automate_stdio.at +++ tests/t_automate_stdio.at @@ -0,0 +1,12 @@ +AT_SETUP([automate stdio]) +MONOTONE_SETUP + +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_CLEANUP --- testsuite.at +++ testsuite.at @@ -651,3 +651,4 @@ m4_include(tests/t_automate_certs.at) m4_include(tests/t_selector_later_earlier.at) m4_include(tests/t_merge_binary.at) +m4_include(tests/t_automate_stdio.at)