michael@0: #!/usr/bin/perl michael@0: # michael@0: # gen_template.pl michael@0: # Makes docshell test case templates. michael@0: # Takes one argument: michael@0: # michael@0: # -b : a bugnumber michael@0: # michael@0: # e.g.: perl gen_template.pl -b 303267 michael@0: # michael@0: # Writes test case template files for bug 303267 to the current directory. michael@0: use FindBin; michael@0: use Getopt::Long; michael@0: GetOptions("b=i"=> \$bug_number); michael@0: michael@0: $template = "$FindBin::RealBin/test.template.txt"; michael@0: michael@0: open(IN,$template) or die("Failed to open input file for reading."); michael@0: open(OUT, ">>test_bug" . $bug_number . ".xul") or die("Failed to open output file for appending."); michael@0: while((defined(IN)) && ($line = )) { michael@0: $line =~ s/{BUGNUMBER}/$bug_number/g; michael@0: print OUT $line; michael@0: } michael@0: close(IN); michael@0: close(OUT); michael@0: michael@0: $template = "$FindBin::RealBin/window.template.txt"; michael@0: michael@0: open(IN,$template) or die("Failed to open input file for reading."); michael@0: open(OUT, ">>bug" . $bug_number . "_window.xul") or die("Failed to open output file for appending."); michael@0: while((defined(IN)) && ($line = )) { michael@0: $line =~ s/{BUGNUMBER}/$bug_number/g; michael@0: print OUT $line; michael@0: } michael@0: close(IN); michael@0: close(OUT); michael@0: