Skip to content

Commit

Permalink
testsuite: Print a test summary for the spectest
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Oct 28, 2024
1 parent 95da9af commit 5133692
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/testsuite/afparg.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ char *Test = "";
CONN *Conn2;
int Mac = 0;
char Data[1] = "";
int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;

/* =============================== */
static void list_tests(void)
Expand Down
5 changes: 5 additions & 0 deletions test/testsuite/afphelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ void test_nottested(void)
ExitCode = 2;
#endif
CurTestResult = 2;
NotTestedCount += 1;
}

/* ------------------------- */
Expand All @@ -942,13 +943,15 @@ void exit_test(char *name)

switch (CurTestResult) {
case 0:
PassCount += 1;
if (Color) {
s = ANSI_BGREEN "PASSED" ANSI_NORMAL;
} else {
s = "PASSED";
}
break;
case 1:
FailCount += 1;
if (Color) {
s = ANSI_BRED "FAILED" ANSI_NORMAL;
} else {
Expand All @@ -959,13 +962,15 @@ void exit_test(char *name)
fflush(stdout);
return;
case 2:
NotTestedCount += 1;
if (Color) {
s = ANSI_BYELLOW "NOT TESTED" ANSI_NORMAL;
} else {
s = "NOT TESTED";
}
break;
case 3:
SkipCount += 1;
s = skipped_msg_buf;
break;
}
Expand Down
5 changes: 5 additions & 0 deletions test/testsuite/encoding_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ char *Encoding = "western";
extern int Convert;
static char temp[MAXPATHLEN];

int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;

/* ------------------------- */
int empty_volume()
{
Expand Down
10 changes: 8 additions & 2 deletions test/testsuite/lantest.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#define NUMTESTS (LASTTEST+1)

CONN *Conn;
CONN *Conn2;
uint16_t VolID;
int ExitCode = 0;
char Data[300000] = "";
char *Vol = "";
Expand All @@ -38,6 +36,14 @@ char *Path;
int Version = 34;
int Mac = 0;

/* Unused */
CONN *Conn2;
uint16_t VolID;
int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;

/* Configure the tests */
#define DIRNUM 10 /* 10^3 nested dirs */
static int smallfiles = 1000; /* 1000 files */
Expand Down
4 changes: 4 additions & 0 deletions test/testsuite/logintest.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ CONN *Conn;
CONN *Conn2;

int ExitCode = 0;
int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;

DSI *Dsi;

Expand Down
13 changes: 13 additions & 0 deletions test/testsuite/spectest.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ CONN *Conn;
CONN *Conn2;

int ExitCode = 0;
int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;


#define FN(a) a ## _test
Expand Down Expand Up @@ -613,5 +617,14 @@ int ret;
if (User2) {
FPLogOut(Conn2);
}

fprintf(stdout,"===================\n");
fprintf(stdout,"TEST RESULT SUMMARY\n");
fprintf(stdout,"-------------------\n");
fprintf(stdout, " Passed: %d\n", PassCount);
fprintf(stdout, " Failed: %d\n", FailCount);
fprintf(stdout, " Skipped: %d\n", SkipCount);
fprintf(stdout, " Not tested: %d\n", NotTestedCount);

return ExitCode;
}
4 changes: 4 additions & 0 deletions test/testsuite/speedtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ static int Direct = 0;
/* not used */
CONN *Conn2;
int Mac = 0;
int PassCount = 0;
int FailCount = 0;
int SkipCount = 0;
int NotTestedCount = 0;

struct vfs {
unsigned int (*getfiledirparams)(CONN *, uint16_t , int , char *, uint16_t, uint16_t);
Expand Down
5 changes: 5 additions & 0 deletions test/testsuite/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,8 @@ extern int Color;
extern int Interactive;
extern int Throttle;
extern int Exclude;

extern int PassCount;
extern int FailCount;
extern int SkipCount;
extern int NotTestedCount;

0 comments on commit 5133692

Please sign in to comment.