> > Thanks. I have a idea on the search method. Actually, my problem is I have 
> no idea how to feed the input data to c program,(using ruby inline?)and output 
> the coverage(I try to add some c code into the c program to get the statement 
> coverage)to the ruby, some suggest me to use command line to input the data to 
> c program,but there is a problem
> like that :
> system "./triangle"    #call c program
> foo xxxxx
> 
> program will excute the c c program first, and after it terminate, then will 
> excute the next line in ruby.

Have you tried pipes?  You could connect Ruby to the stdin and stdout
of your 'C' program and communicate to it like that.

There's an IO#popen example in Pickaxe, Chapter 11, under the Running
Multiple Processes section.

It looks like:  [any typos are my fault ;)]

  pig = IO.popen("pig", "w+")
  pig.puts "ice cream after they go to bed"
  pig.close_write
  puts pig.gets

Where 'pig' is the 'C' program.  (And produces the output,
"iceway eamcray afterway eythay ogay otay edbay")

This way your 'C' program would read its input test data from
stdin, and write its coverage statistics to stdout.....

Hope this helps,

Bill