testy - first cut
git-svn-id: svn://10.0.0.236/trunk@140995 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
49
mozilla/tools/testy/TestySupport.cpp
Normal file
49
mozilla/tools/testy/TestySupport.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "nspr.h"
|
||||
#include "TestySupport.h"
|
||||
|
||||
FILE* gLogFile = NULL;
|
||||
|
||||
int Testy_LogInit(const char* fileName)
|
||||
{
|
||||
gLogFile = fopen(fileName, "r+b");
|
||||
if (!gLogFile) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Testy_LogShutdown()
|
||||
{
|
||||
if (gLogFile)
|
||||
fclose(gLogFile);
|
||||
}
|
||||
|
||||
|
||||
void Testy_LogStart(const char* name)
|
||||
{
|
||||
PR_ASSERT(gLogFile);
|
||||
fprintf(gLogFile, "Test Case: %s", name);
|
||||
fflush(gLogFile);
|
||||
}
|
||||
|
||||
void Testy_LogComment(const char* name, const char* comment)
|
||||
{
|
||||
PR_ASSERT(gLogFile);
|
||||
fprintf(gLogFile, "Test Case: %s\n\t%s", name, comment);
|
||||
fflush(gLogFile);
|
||||
}
|
||||
|
||||
void Testy_LogEnd(const char* name, PRBool passed)
|
||||
{
|
||||
PR_ASSERT(gLogFile);
|
||||
fprintf(gLogFile, "Test Case: %s (%s)", name, passed ? "Passed" : "Failed");
|
||||
fflush(gLogFile);
|
||||
}
|
||||
|
||||
void Testy_GenericStartup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Testy_GenericShutdown()
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user