testing - Writing Bash script to test C Program -


i quite new bash scripting , thinking of using run few test cases c program. have results expected in file called output.txt

i run program:

./a.out > output_res_gen.txt

diff output_gen.txt output_res_gen.txt

if program has run correct following difference:

10001c10001 < time: 0.291555 --- > time: 0.111091 

(that time taken execute code, can vary).

i wrote bash script follows:

#!/bin/bash cd .. ./a.out > ../tests/output_res_gen.txt diff ../tests/output_gen.txt ../tests/output_res_gen.txt 

however code not execute (./a.out not run). there way find difference between 2 files , verify difference in between time execute?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -