michael@0: #!/usr/bin/perl michael@0: # michael@0: # gen_template.pl michael@0: # Makes test case templates. michael@0: # Takes two arguments: michael@0: # michael@0: # -b : a bugnumber michael@0: # -type : template type. {html|xhtml|xul|th}. defaults to html. michael@0: # michael@0: # perl gen_template.pl -b 345876 -type xul michael@0: # michael@0: # sends a test case template for bug 345876 to stdout michael@0: use FindBin; michael@0: use Getopt::Long; michael@0: GetOptions("b=i"=> \$bug_number, michael@0: "type:s"=> \$template_type); michael@0: michael@0: if ($template_type eq "xul") { michael@0: $template_type = "$FindBin::RealBin/static/xul.template.txt"; michael@0: } elsif ($template_type eq "xhtml") { michael@0: $template_type = "$FindBin::RealBin/static/xhtml.template.txt"; michael@0: } elsif ($template_type eq "chrome") { michael@0: $template_type = "$FindBin::RealBin/static/chrome.template.txt"; michael@0: } elsif ($template_type eq "th") { michael@0: $template_type = "$FindBin::RealBin/static/th.template.txt"; michael@0: } else { michael@0: $template_type = "$FindBin::RealBin/static/test.template.txt"; michael@0: } michael@0: michael@0: open(IN,$template_type) or die("Failed to open myfile for reading."); michael@0: while((defined(IN)) && ($line = )) { michael@0: $line =~ s/{BUGNUMBER}/$bug_number/g; michael@0: print STDOUT $line; michael@0: } michael@0: close(IN);