Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 #!/usr/bin/perl
2 #
3 # gen_template.pl
4 # Makes docshell test case templates.
5 # Takes one argument:
6 #
7 # -b : a bugnumber
8 #
9 # e.g.: perl gen_template.pl -b 303267
10 #
11 # Writes test case template files for bug 303267 to the current directory.
12 use FindBin;
13 use Getopt::Long;
14 GetOptions("b=i"=> \$bug_number);
16 $template = "$FindBin::RealBin/test.template.txt";
18 open(IN,$template) or die("Failed to open input file for reading.");
19 open(OUT, ">>test_bug" . $bug_number . ".xul") or die("Failed to open output file for appending.");
20 while((defined(IN)) && ($line = <IN>)) {
21 $line =~ s/{BUGNUMBER}/$bug_number/g;
22 print OUT $line;
23 }
24 close(IN);
25 close(OUT);
27 $template = "$FindBin::RealBin/window.template.txt";
29 open(IN,$template) or die("Failed to open input file for reading.");
30 open(OUT, ">>bug" . $bug_number . "_window.xul") or die("Failed to open output file for appending.");
31 while((defined(IN)) && ($line = <IN>)) {
32 $line =~ s/{BUGNUMBER}/$bug_number/g;
33 print OUT $line;
34 }
35 close(IN);
36 close(OUT);