testing/mochitest/gen_template.pl
author Joshua Cranmer <Pidgeot18@gmail.com>
Wed, 23 Jul 2008 09:26:17 -0400
changeset 16140 616403a5a73e85800cb448265a6b3b71a01aece3
parent 1 9b2a99adc05e53cd4010de512f50118594756650
child 37150 9206cc10a0d18a37134eaa09b4351b281475d581
permissions -rw-r--r--
Bug 433206 - Update doxygen.cfg.in r=biesi, sr=bsmedberg

#!/usr/bin/perl
#
#  gen_template.pl
#  Makes test case templates.
#  Takes two arguments:
#
#  -b : a bugnumber
#  -type : template type. {html|xhtml|xul}. 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";
} 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);