Modified parser test script.

** NOT PART OF THE BUILD **
This commit is contained in:
harishd%netscape.com 2001-02-16 17:44:23 +00:00
parent cef0dff830
commit bdca09dd7b
4 changed files with 24 additions and 28 deletions

View File

@ -23,7 +23,6 @@
#include "nsParserCIID.h"
#include "nsIParser.h"
#include "nsILoggingSink.h"
#include "CNavDTD.h"
#include "nsIInputStream.h"
#include "prprf.h"
#include <fstream.h>
@ -46,6 +45,8 @@ static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID);
static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID);
//----------------------------------------------------------------------
static void SetupRegistry()
@ -93,7 +94,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) {
if (NS_SUCCEEDED(result)) {
// Create a dtd
nsCOMPtr<nsIDTD> dtd;
result=NS_NewNavHTMLDTD(getter_AddRefs(dtd));
result=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd));
if(NS_SUCCEEDED(result)) {
// Parse the document, having the sink write the data to fp
PRFileDesc* out;

View File

@ -7,28 +7,25 @@
$drive=$`;
die "\nUsage: perl TestParser.pl [-b|-v|-c] <filelist>
b -> creates baseline file(*.b)
v -> creates verification file (*.v)
c -> compare baseline vs verification\n"
die "\nUsage: perl TestParser.pl [-b|-v] <filelist>
b -> create baseline
v -> verify changes\n"
if(@ARGV < 2 || @ARGV > 2);
open(FILE_LIST,$ARGV[1]) || die "\nCannot open $ARGV[1]\n";
if($ARGV[0] eq "-b" || $ARGV[0] eq "-v") {
$ARGV[0]=~s/-//g; # create file extension for the output
if($ARGV[0] eq "-b") {
foreach $input(<FILE_LIST>) {
@output=split(/\./,$input);
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].$ARGV[0]");
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].b");
}
}
elsif($ARGV[0] eq "-c") {
# use windows "fc" to compare files!!!
foreach $input(<FILE_LIST>) {
elsif($ARGV[0] eq "-v") {
foreach $input(<FILE_LIST>) {
@output=split(/\./,$input);
system("fc $output[0].b $output[0].v");
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].v");
system("fc $output[0].b $output[0].v");
}
}
else {

View File

@ -23,7 +23,6 @@
#include "nsParserCIID.h"
#include "nsIParser.h"
#include "nsILoggingSink.h"
#include "CNavDTD.h"
#include "nsIInputStream.h"
#include "prprf.h"
#include <fstream.h>
@ -46,6 +45,8 @@ static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID);
static NS_DEFINE_IID(kIParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID);
static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID);
//----------------------------------------------------------------------
static void SetupRegistry()
@ -93,7 +94,7 @@ nsresult ParseData(char* anInputStream,char* anOutputStream) {
if (NS_SUCCEEDED(result)) {
// Create a dtd
nsCOMPtr<nsIDTD> dtd;
result=NS_NewNavHTMLDTD(getter_AddRefs(dtd));
result=nsComponentManager::CreateInstance(kNavDTDCID,nsnull,NS_GET_IID(nsIDTD),getter_AddRefs(dtd));
if(NS_SUCCEEDED(result)) {
// Parse the document, having the sink write the data to fp
PRFileDesc* out;

View File

@ -7,28 +7,25 @@
$drive=$`;
die "\nUsage: perl TestParser.pl [-b|-v|-c] <filelist>
b -> creates baseline file(*.b)
v -> creates verification file (*.v)
c -> compare baseline vs verification\n"
die "\nUsage: perl TestParser.pl [-b|-v] <filelist>
b -> create baseline
v -> verify changes\n"
if(@ARGV < 2 || @ARGV > 2);
open(FILE_LIST,$ARGV[1]) || die "\nCannot open $ARGV[1]\n";
if($ARGV[0] eq "-b" || $ARGV[0] eq "-v") {
$ARGV[0]=~s/-//g; # create file extension for the output
if($ARGV[0] eq "-b") {
foreach $input(<FILE_LIST>) {
@output=split(/\./,$input);
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].$ARGV[0]");
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].b");
}
}
elsif($ARGV[0] eq "-c") {
# use windows "fc" to compare files!!!
foreach $input(<FILE_LIST>) {
elsif($ARGV[0] eq "-v") {
foreach $input(<FILE_LIST>) {
@output=split(/\./,$input);
system("fc $output[0].b $output[0].v");
system("$drive://mozilla//dist//WIN32_D.obj//bin//TestParser.exe $input $output[0].v");
system("fc $output[0].b $output[0].v");
}
}
else {