Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / testing / mochitest / gen_template.pl
blob18aced47fc340c30ad951608a924e4d26227882d
1 #!/usr/bin/perl
3 # gen_template.pl
4 # Makes test case templates.
5 # Takes two arguments:
7 # -b : a bugnumber
8 # -type : template type. {html|xhtml|xul}. defaults to html.
10 # perl gen_template.pl -b 345876 -type xul
12 # sends a test case template for bug 345876 to stdout
13 use FindBin;
14 use Getopt::Long;
15 GetOptions("b=i"=> \$bug_number,
16 "type:s"=> \$template_type);
18 if ($template_type eq "xul") {
19 $template_type = "$FindBin::RealBin/static/xul.template.txt";
20 } elsif ($template_type eq "xhtml") {
21 $template_type = "$FindBin::RealBin/static/xhtml.template.txt";
22 } else {
23 $template_type = "$FindBin::RealBin/static/test.template.txt";
26 open(IN,$template_type) or die("Failed to open myfile for reading.");
27 while((defined(IN)) && ($line = <IN>)) {
28 $line =~ s/{BUGNUMBER}/$bug_number/g;
29 print STDOUT $line;
31 close(IN);