forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestySupport.cpp
53 lines (41 loc) · 1012 Bytes
/
TestySupport.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nspr.h"
#include "TestySupport.h"
FILE* gLogFile = NULL;
int Testy_LogInit(const char* fileName)
{
gLogFile = fopen(fileName, "w+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, bool passed)
{
PR_ASSERT(gLogFile);
fprintf(gLogFile, "Test Case: %s (%s)", name, passed ? "Passed" : "Failed");
fflush(gLogFile);
}
void Testy_GenericStartup()
{
}
void Testy_GenericShutdown()
{
}