Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc
slurm
Commits
b26d3286
Commit
b26d3286
authored
22 years ago
by
jce
Browse files
Options
Downloads
Patches
Plain Diff
Added test numbers.
parent
318b3fdf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/dejagnu.h
+129
-124
129 additions, 124 deletions
testsuite/dejagnu.h
with
129 additions
and
124 deletions
testsuite/dejagnu.h
+
129
−
124
View file @
b26d3286
...
...
@@ -25,10 +25,11 @@
#define _BUFFER_SIZE_ 512
static
int
passed
;
static
int
failed
;
static
int
untest
;
static
int
unresolve
;
static
int
passed
=
0
;
static
int
failed
=
0
;
static
int
untest
=
0
;
static
int
unresolve
=
0
;
static
int
tests
=
0
;
static
char
buffer
[
_BUFFER_SIZE_
];
...
...
@@ -36,12 +37,13 @@ static char buffer[ _BUFFER_SIZE_ ];
inline
void
pass
(
const
char
*
fmt
,
...
)
{
va_list
ap
;
passed
++
;
tests
++
;
passed
++
;
va_start
(
ap
,
fmt
);
vsnprintf
(
buffer
,
_BUFFER_SIZE_
,
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\t
PASSED: %s
\n
"
,
buffer
);
printf
(
"
\t
PASSED:
#%d
%s
\n
"
,
tests
,
buffer
);
fflush
(
stdout
);
}
...
...
@@ -49,11 +51,12 @@ inline void
fail
(
const
char
*
fmt
,
...
)
{
va_list
ap
;
failed
++
;
tests
++
;
failed
++
;
va_start
(
ap
,
fmt
);
vsnprintf
(
buffer
,
_BUFFER_SIZE_
,
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\t
FAILED: %s
\n
"
,
buffer
);
printf
(
"
\t
FAILED:
#%d
%s
\n
"
,
tests
,
buffer
);
fflush
(
stdout
);
}
...
...
@@ -61,11 +64,12 @@ inline void
untested
(
const
char
*
fmt
,
...
)
{
va_list
ap
;
untest
++
;
tests
++
;
untest
++
;
va_start
(
ap
,
fmt
);
vsnprintf
(
buffer
,
_BUFFER_SIZE_
,
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\t
UNTESTED: %s
\n
"
,
buffer
);
printf
(
"
\t
UNTESTED:
#%d
%s
\n
"
,
tests
,
buffer
);
fflush
(
stdout
);
}
...
...
@@ -73,11 +77,12 @@ inline void
unresolved
(
const
char
*
fmt
,
...
)
{
va_list
ap
;
unresolve
++
;
tests
++
;
unresolve
++
;
va_start
(
ap
,
fmt
);
vsnprintf
(
buffer
,
_BUFFER_SIZE_
,
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\t
UNRESOLVED: %s
\n
"
,
buffer
);
printf
(
"
\t
UNRESOLVED:
#%d
%s
\n
"
,
tests
,
buffer
);
fflush
(
stdout
);
}
...
...
@@ -88,19 +93,19 @@ note (const char* fmt, ... ) {
va_start
(
ap
,
fmt
);
vsnprintf
(
buffer
,
_BUFFER_SIZE_
,
fmt
,
ap
);
va_end
(
ap
);
printf
(
"
\t
NOTE: %s
\n
"
,
buffer
);
printf
(
"
\t
NOTE: %s
\n
"
,
buffer
);
fflush
(
stdout
);
}
inline
void
totals
(
void
)
{
printf
(
"
\n
Totals:
\n
"
);
printf
(
"
\t
#passed:
\t\t
%d
\n
"
,
passed
);
printf
(
"
\t
#failed:
\t\t
%d
\n
"
,
failed
);
if
(
untest
)
printf
(
"
\t
#untested:
\t\t
%d
\n
"
,
untest
);
if
(
unresolve
)
printf
(
"
\t
#unresolved:
\t\t
%d
\n
"
,
unresolve
);
printf
(
"
\n
Totals:
\n
"
);
printf
(
"
\t
#passed:
\t\t
%d
\n
"
,
passed
);
printf
(
"
\t
#failed:
\t\t
%d
\n
"
,
failed
);
if
(
untest
)
printf
(
"
\t
#untested:
\t\t
%d
\n
"
,
untest
);
if
(
unresolve
)
printf
(
"
\t
#unresolved:
\t\t
%d
\n
"
,
unresolve
);
}
#ifdef __cplusplus
...
...
@@ -119,10 +124,10 @@ totals (void) {
#endif
const
char
*
outstate_list
[]
=
{
"FAILED: "
,
"PASSED: "
,
"UNTESTED: "
,
"UNRESOLVED: "
"FAILED: "
,
"PASSED: "
,
"UNTESTED: "
,
"UNRESOLVED: "
};
const
char
**
outstate
=
outstate_list
;
...
...
@@ -130,124 +135,124 @@ const char ** outstate = outstate_list;
#if 0
extern ios& __iomanip_testout (ios&, int);
inline smanip<int> testout (int n) {
return smanip<int> (__iomanip_testout, n);
return smanip<int> (__iomanip_testout, n);
}
ios & __iomanip_testout (ios& i, int x) {
return i;
return i;
}
template<class T>
class OMANIP {
private:
T i;
ostream &(*f)(ostream&, T);
public:
OMANIP(ostream& (*ff)(ostream&, T), T ii) : f(ff), i(ii) {
}
friend ostream operator<<(ostream& us, OMANIP& m) {
return m.f(os,m.i);
}
private:
T i;
ostream &(*f)(ostream&, T);
public:
OMANIP(ostream& (*ff)(ostream&, T), T ii) : f(ff), i(ii) {
}
friend ostream operator<<(ostream& us, OMANIP& m) {
return m.f(os,m.i);
}
};
ostream&
freakout(ostream& os, int x) {
return os << "FREAKOUT" ;
// return x << "TESTOUT " << x ;
return os << "FREAKOUT" ;
// return x << "TESTOUT " << x ;
}
OMANIP<int> testout(int i) {
return OMANIP<int>(&freakout,i);
return OMANIP<int>(&freakout,i);
}
#endif
enum
teststate
{
FAILED
,
PASSED
,
UNTESTED
,
UNRESOLVED
}
laststate
;
class
TestState
{
private:
teststate
laststate
;
std
::
string
lastmsg
;
public:
TestState
(
void
)
{
passed
=
0
;
failed
=
0
;
untest
=
0
;
unresolve
=
0
;
}
~
TestState
(
void
)
{
totals
();
};
void
testrun
(
bool
b
,
std
::
string
s
)
{
if
(
b
)
pass
(
s
);
else
fail
(
s
);
}
void
pass
(
std
::
string
s
)
{
passed
++
;
laststate
=
PASSED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
PASSED
]
<<
s
<<
std
::
endl
;
}
void
pass
(
const
char
*
c
)
{
std
::
string
s
=
c
;
pass
(
s
);
}
void
fail
(
std
::
string
s
)
{
failed
++
;
laststate
=
FAILED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
FAILED
]
<<
s
<<
std
::
endl
;
}
void
fail
(
const
char
*
c
)
{
std
::
string
s
=
c
;
fail
(
s
);
}
void
untested
(
std
::
string
s
)
{
untest
++
;
laststate
=
UNTESTED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
UNTESTED
]
<<
s
<<
std
::
endl
;
}
void
untested
(
const
char
*
c
)
{
std
::
string
s
=
c
;
untested
(
s
);
}
void
unresolved
(
std
::
string
s
)
{
unresolve
++
;
laststate
=
UNRESOLVED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
UNRESOLVED
]
<<
s
<<
std
::
endl
;
}
void
unresolved
(
const
char
*
c
)
{
std
::
string
s
=
c
;
unresolved
(
s
);
}
void
totals
(
void
)
{
std
::
cout
<<
"
\t
#passed:
\t\t
"
<<
passed
<<
std
::
endl
;
std
::
cout
<<
"
\t
#failed:
\t\t
"
<<
failed
<<
std
::
endl
;
if
(
untest
)
std
::
cout
<<
"
\t
#untested:
\t\t
"
<<
untest
<<
std
::
endl
;
if
(
unresolve
)
std
::
cout
<<
"
\t
#unresolved:
\t\t
"
<<
unresolve
<<
std
::
endl
;
}
// This is so this class can be printed in an ostream.
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
TestState
&
t
)
{
return
os
<<
"
\t
"
<<
outstate
[
t
.
laststate
]
<<
t
.
lastmsg
;
}
int
GetState
(
void
)
{
return
laststate
;
}
std
::
string
GetMsg
(
void
)
{
return
lastmsg
;
}
private:
teststate
laststate
;
std
::
string
lastmsg
;
public:
TestState
(
void
)
{
passed
=
0
;
failed
=
0
;
untest
=
0
;
unresolve
=
0
;
}
~
TestState
(
void
)
{
totals
();
};
void
testrun
(
bool
b
,
std
::
string
s
)
{
if
(
b
)
pass
(
s
);
else
fail
(
s
);
}
void
pass
(
std
::
string
s
)
{
passed
++
;
laststate
=
PASSED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
PASSED
]
<<
s
<<
std
::
endl
;
}
void
pass
(
const
char
*
c
)
{
std
::
string
s
=
c
;
pass
(
s
);
}
void
fail
(
std
::
string
s
)
{
failed
++
;
laststate
=
FAILED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
FAILED
]
<<
s
<<
std
::
endl
;
}
void
fail
(
const
char
*
c
)
{
std
::
string
s
=
c
;
fail
(
s
);
}
void
untested
(
std
::
string
s
)
{
untest
++
;
laststate
=
UNTESTED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
UNTESTED
]
<<
s
<<
std
::
endl
;
}
void
untested
(
const
char
*
c
)
{
std
::
string
s
=
c
;
untested
(
s
);
}
void
unresolved
(
std
::
string
s
)
{
unresolve
++
;
laststate
=
UNRESOLVED
;
lastmsg
=
s
;
std
::
cout
<<
"
\t
"
<<
outstate
[
UNRESOLVED
]
<<
s
<<
std
::
endl
;
}
void
unresolved
(
const
char
*
c
)
{
std
::
string
s
=
c
;
unresolved
(
s
);
}
void
totals
(
void
)
{
std
::
cout
<<
"
\t
#passed:
\t\t
"
<<
passed
<<
std
::
endl
;
std
::
cout
<<
"
\t
#failed:
\t\t
"
<<
failed
<<
std
::
endl
;
if
(
untest
)
std
::
cout
<<
"
\t
#untested:
\t\t
"
<<
untest
<<
std
::
endl
;
if
(
unresolve
)
std
::
cout
<<
"
\t
#unresolved:
\t\t
"
<<
unresolve
<<
std
::
endl
;
}
// This is so this class can be printed in an ostream.
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
TestState
&
t
)
{
return
os
<<
"
\t
"
<<
outstate
[
t
.
laststate
]
<<
t
.
lastmsg
;
}
int
GetState
(
void
)
{
return
laststate
;
}
std
::
string
GetMsg
(
void
)
{
return
lastmsg
;
}
};
#endif // __cplusplus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment