home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 December / PCWorld_2000-12_cd.bin / Komunikace / mozilla / mozilla-win32-M18-mathml-svg-xslt.exe / TestOutSinks.pl < prev    next >
Perl Script  |  2000-09-08  |  5KB  |  123 lines

  1. #! /usr/bin/perl
  2.  
  3. # The contents of this file are subject to the Netscape Public
  4. # License Version 1.1 (the "License"); you may not use this file
  5. # except in compliance with the License. You may obtain a copy of
  6. # the License at http://www.mozilla.org/NPL/
  7. #  
  8. # Software distributed under the License is distributed on an "AS
  9. # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10. # implied. See the License for the specific language governing
  11. # rights and limitations under the License.
  12. #  
  13. # The Original Code is Mozilla Communicator client code, released
  14. # March 31, 1998.
  15. # The Initial Developer of the Original Code is Netscape
  16. # Communications Corporation. Portions created by Netscape are
  17. # Copyright (C) 1998-1999 Netscape Communications Corporation. All
  18. # Rights Reserved.
  19. # Contributor(s): Akkana Peck.
  20.  
  21. #
  22. # This is a collection of test files to guard against regressions
  23. # in the Mozilla output system.
  24. #
  25.  
  26. # Make sure . is in the path, so we can load the other shared libraries
  27. $ENV{LD_LIBRARY_PATH} .= ":.";
  28.  
  29. $errmsg = "";
  30.  
  31. print "Testing simple html to html ...\n";
  32. $status = system("TestOutput -i text/html -o text/html -f 0 -c OutTestData/simple.html OutTestData/simple.html");
  33. if ($status != 0) {
  34.   print "Simple html to html failed.\n";
  35.   $errmsg = "$errmsg simple.html";
  36. }
  37.  
  38. print "Testing simple copy case ...\n";
  39. $status = system("TestOutput -i text/html -o text/plain -f 0 -w 0 -c OutTestData/simplecopy.out OutTestData/simple.html");
  40. if ($status != 0) {
  41.   print "Simple copy test failed.\n";
  42.   $errmsg = "$errmsg simplecopy.out";
  43. }
  44.  
  45. print "Testing simple html to plaintext formatting ...\n";
  46. $status = system("TestOutput -i text/html -o text/plain -f 34 -w 70 -c OutTestData/simplefmt.out OutTestData/simple.html");
  47. if ($status != 0) {
  48.   print("Simple formatting test failed.\n");
  49.   $errmsg = "$errmsg simplefmt.out ";
  50. }
  51.  
  52. print "Testing non-wrapped plaintext in preformatted mode ...\n";
  53. $status = system("TestOutput -i text/html -o text/plain -f 16 -c OutTestData/plainnowrap.out OutTestData/plain.html");
  54. if ($status != 0) {
  55.   print "Non-wrapped plaintext test failed.\n";
  56.   $errmsg = "$errmsg plainnowrap.out";
  57. }
  58.  
  59. # print "Testing wrapped and formatted plaintext ...\n";
  60. # $status = system("TestOutput -i text/html -o text/plain -f 32 -c OutTestData/plainwrap.out OutTestData/plain.html");
  61. # if ($status != 0) {
  62. #   print "Wrapped plaintext test failed.\n";
  63. #   $errmsg = "$errmsg plainwrap.out";
  64. # }
  65.  
  66. print "Testing mail quoting ...\n";
  67. $status = system("TestOutput -i text/html -o text/plain -f 2 -w 50 -c OutTestData/mailquote.out OutTestData/mailquote.html");
  68. if ($status != 0) {
  69.   print "Mail quoting test failed.\n";
  70.   $errmsg = "$errmsg mailquote.out";
  71. }
  72.  
  73. print "Testing format=flowed output ...\n";
  74. $status = system("TestOutput -i text/html -o text/plain -f 66 -w 50 -c OutTestData/simplemail.out OutTestData/simplemail.html");
  75. if ($status != 0) {
  76.   print "Format=flowed test failed.\n";
  77.   $errmsg = "$errmsg simplemail.out";
  78. }
  79.  
  80. print "Testing conversion of XIF entities ...\n";
  81. $status = system("TestOutput -i text/xif -o text/plain -c OutTestData/entityxif.out OutTestData/entityxif.xif");
  82. if ($status != 0) {
  83.   print "XIF entity conversion test failed.\n";
  84.   $errmsg = "$errmsg entityxif.out";
  85. }
  86.  
  87. print "Testing XIF to HTML ...\n";
  88. $status = system("TestOutput -i text/xif -o text/html -c OutTestData/xifstuff.out OutTestData/xifstuff.xif");
  89. if ($status != 0) {
  90.   print "XIF to HTML conversion test failed.\n";
  91.   $errmsg = "$errmsg xifstuff.out";
  92. }
  93.  
  94. print "Testing HTML Table to Text ...\n";
  95. $status = system("TestOutput -i text/html -o text/plain -f 2 -c OutTestData/htmltable.out OutTestData/htmltable.html");
  96. if ($status != 0) {
  97.   print "HTML Table to Plain text failed.\n";
  98.   $errmsg = "$errmsg htmltable.out";
  99. }
  100.  
  101. print "Testing XIF to plain with doctype (bug 28447) ...\n";
  102. $status = system("TestOutput -i text/xif -o text/plain -f 2 -c OutTestData/xifdtplain.out OutTestData/doctype.xif");
  103. if ($status != 0) {
  104.   print "XIF to plain with doctype failed.\n";
  105.   $errmsg = "$errmsg xifdtplain.out";
  106. }
  107.  
  108. print "Testing XIF to html with doctype ...\n";
  109. $status = system("TestOutput -i text/xif -o text/html -f 0 -c OutTestData/xifdthtml.out OutTestData/doctype.xif");
  110. if ($status != 0) {
  111.   print "XIF to html with doctype failed.\n";
  112.   $errmsg = "$errmsg xifdthtml.out";
  113. }
  114.  
  115. if ($errmsg ne "") {
  116.   print "\nERROR: DOM CONVERSION TEST FAILED: $errmsg\n";
  117.   exit 1
  118. } else {
  119.   print "DOM CONVERSION TESTS SUCCEEDED\n";
  120. }
  121.