This checkin takes us a little closer to the unit tests running. I'm

still seeing non-ignorable differences in the golden file, which I
must address.

M README

- remove quotes from env vars

M webclient/src_moz/WrapperFactoryImpl.cpp

- make the native.waitForDebugger mechanism work on Win32.

M webclient/test/automated/src/classes/org/mozilla/webclient/CompareFiles.java

- Tweaks to optionally ignore WARNING: messages

- Tweaks to ignore lines containing keywords, such as nativeBinDir,
  which changes from platform to platform and user to user

M webclient/test/automated/src/classes/org/mozilla/webclient/WebclientTestCase.java

- formatting
This commit is contained in:
edburns%acm.org 2004-02-25 05:44:08 +00:00
Родитель c1eaa4c117
Коммит cc6add0020
4 изменённых файлов: 54 добавлений и 15 удалений

Просмотреть файл

@ -37,6 +37,7 @@ How To Build:
######
build.unix.classes=true
build.win32.classes=false
build.home=/home/edburns/Projects/mozilla/MOZILLA_1_4/mozilla/dist/classes
compile.debug=true
######
@ -55,11 +56,14 @@ How to run the Junit tests:
* Set the following variables in your environment
NSPR_LOG_MODULES="webclient:4,webclientstub:4"
NSPR_LOG_FILE="logfile.txt"
NSPR_LOG_MODULES=webclient:4,webclientstub:4
NSPR_LOG_FILE=logfile.txt
* cd to mozilla/java/webclient
* Kill any running mozilla instances. These will mess up the
profilemanager code.
* run ant test
How to run the test browser (broken as of this writing):

Просмотреть файл

@ -45,6 +45,9 @@
#ifdef XP_UNIX
#include <unistd.h> // for getpid
#endif
#ifdef XP_PC
#include <windows.h> // for GetCurrentProcessId()
#endif
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
@ -133,17 +136,20 @@ Java_org_mozilla_webclient_impl_wrapper_1native_WrapperFactoryImpl_nativeAppInit
PR_LOG(prLogModuleInfo, PR_LOG_DEBUG,
("WrapperFactoryImpl_nativeAppInitialize: exiting\n"));
#ifdef XP_UNIX
char propValue[50];
::util_getSystemProperty(env, "native.waitForDebugger", propValue, 50);
if (nsnull != propValue[0] &&
0 < nsCRT::strlen(propValue)) {
#ifdef XP_UNIX
pid_t pid = getpid();
printf("++++++++++++++++debug: pid is: %d\n", pid);
fflush(stdout);
sleep(7);
}
#endif
#ifdef XP_PC
printf("++++++++++++++++debug: pid is: %d\n", GetCurrentProcessId());
#endif
fflush(stdout);
PR_Sleep(700000);
}
// Store our pointer to the global vm
if (nsnull == gVm) { // declared in ../src_share/jni_util.h

Просмотреть файл

@ -1,5 +1,5 @@
/*
* $Id: CompareFiles.java,v 1.1 2002-10-01 00:39:28 edburns%acm.org Exp $
* $Id: CompareFiles.java,v 1.2 2004-02-25 05:44:08 edburns%acm.org Exp $
*/
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
@ -43,7 +43,9 @@ public class CompareFiles {
public static boolean filesIdentical (String newFileName,
String oldFileName,
List oldLinesToIgnore,
int ignorePrefix)
boolean ignorePrefix,
boolean ignoreWarnings,
List ignoreKeywords)
throws IOException {
boolean same = true;
@ -68,13 +70,23 @@ public class CompareFiles {
}
while (null != newLine && null != oldLine) {
if (0 < ignorePrefix) {
newLine = newLine.substring(ignorePrefix);
oldLine = oldLine.substring(ignorePrefix);
if (ignorePrefix) {
int bracketColon = 0;
if (-1 != (bracketColon = newLine.indexOf("]: "))) {
newLine = newLine.substring(bracketColon + 3);
}
if (-1 != (bracketColon = oldLine.indexOf("]: "))) {
oldLine = oldLine.substring(bracketColon + 3);
}
}
if (!newLine.equals(oldLine)) {
if (ignoreWarnings && newLine.startsWith("WARNING:")) {
// we're ignoring warnings, no-op
newLine = newReader.readLine(); // swallow the WARNING line
continue;
}
else if (!newLine.equals(oldLine)) {
if (null != oldLinesToIgnore) {
// go thru the list of oldLinesToIgnore and see if
// the current oldLine matches any of them.
@ -91,12 +103,29 @@ public class CompareFiles {
// important
if (!foundMatch) {
same = false;
System.out.println("newLine: " + newLine);
System.out.println("oldLine: " + oldLine);
break;
}
}
else {
same = false;
break;
if (null != ignoreKeywords && 0 < ignoreKeywords.size()) {
Iterator iter = ignoreKeywords.iterator();
while (iter.hasNext()) {
if (-1 != newLine.indexOf((String) iter.next())) {
// we're ignoring lines that contain this
// keyword, no-op
same = true;
break;
}
}
}
if (!same) {
System.out.println("newLine: " + newLine);
System.out.println("oldLine: " + oldLine);
break;
}
}
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны