Home | History | Annotate | Download | only in test
      1 #!/usr/bin/perl
      2 
      3 print "Reading from $ARGV[0]\nWriting to $ARGV[1]\n";
      4 open(LS, "ls $ARGV[0]|");
      5 open(FILE, "> $ARGV[1]");
      6 print FILE "// This file is auto generated using the following command.\n";
      7 print FILE "// Do not modify.\n";
      8 print FILE "// \t./jstocstring.pl $ARGV[0] $ARGV[1]\n";
      9 print FILE "#ifndef PROXY_TEST_SCRIPT_H_\n";
     10 print FILE "#define PROXY_TEST_SCRIPT_H_\n\n";
     11 
     12 while (<LS>) {
     13     chomp();
     14     open(FH, "cat $ARGV[0]/$_|");
     15     if (s/\.js/_JS/) {
     16         $upper = uc();
     17         print FILE "#define $upper \\\n";
     18         while (<FH>) {
     19             s/\"/\\\"/g;
     20             chomp();
     21             print FILE "  \"",$_,"\\n\" \\\n";
     22         }
     23     }
     24     print FILE "\n"
     25 }
     26 print FILE "#endif //PROXY_TEST_SCRIPT_H_\n";
     27 close(FILE);
     28