https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 82603ee87b732c0bdd2cf2f0272ea5676a43beb8 authored by Nick Thomas on 26 November 2014, 22:31:23 UTC
Move tags FIREFOX_34_0_BUILD2, FIREFOX_34_0_RELEASE back to 456394191c90, after accidental 2nd tagging run moved them, a=releng-bunnies-in-a-row
Tip revision: 82603ee
gen_template.pl
#!/usr/bin/perl
#
#  gen_template.pl
#  Makes test case templates.
#  Takes two arguments:
#
#  -b : a bugnumber
#  -type : template type. {html|xhtml|xul|th|chrome|chromexul}. defaults to html.
#
#  perl gen_template.pl -b 345876 -type xul
#
#  sends a test case template for bug 345876 to stdout
use FindBin;
use Getopt::Long;
GetOptions("b=i"=> \$bug_number,
           "type:s"=> \$template_type);

if ($template_type eq "xul") {
  $template_type = "$FindBin::RealBin/static/xul.template.txt";
} elsif ($template_type eq "xhtml") {
  $template_type = "$FindBin::RealBin/static/xhtml.template.txt";
} elsif ($template_type eq "chrome") {
  $template_type = "$FindBin::RealBin/static/chrome.template.txt";
} elsif ($template_type eq "chromexul") {
  $template_type = "$FindBin::RealBin/static/chromexul.template.txt";
} elsif ($template_type eq "th") {
  $template_type = "$FindBin::RealBin/static/th.template.txt";
} else {
  $template_type = "$FindBin::RealBin/static/test.template.txt";
}

open(IN,$template_type) or die("Failed to open myfile for reading.");
while((defined(IN)) && ($line = <IN>)) {
        $line =~ s/{BUGNUMBER}/$bug_number/g;
        print STDOUT $line;
}
close(IN);
back to top