From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-09-20T09:19:36+09:00 Subject: Re: generate the test data in Ruby for a c program In article <000801c26032$47a23800$1800000a@ee.ualberta.ca>, Maggie Xiao wrote: >Hi there, > >I'd like to generate the test data in Ruby for a c program and test it. Has >anyone tried to do it? Can you give me some ideas? What do you think is the >best way to do it ?Any reply will be highly appreciated. > Could you give some more details? One guess would be that this is a standalone C program that takes some input on the command line, like: > foo -name Fred -title Coder and then does something meaningful with the input. You could, in Ruby generate command lines like: results = `foo -name #{name} -title #{occupation}` Then you could check the results string... However, without more details it's kind'a hard to say. If you actually want to access your C code from within Ruby and then do all of your testing inside of Ruby you could use swig (http://www.swig.org)....Why do I feel like that duck in the AFLAC commercial? Instead of 'AFLAC' I say 'Swig'. Phil