Browse Source

Add NOTE function to C++ unit test API

master
Jacob Bachmeyer 3 years ago
parent
commit
9e26e771ed
  1. 3
      ChangeLog
  2. 5
      dejagnu.h
  3. 8
      doc/dejagnu.texi

3
ChangeLog

@ -1,5 +1,8 @@
2022-11-29 Jacob Bachmeyer <jcb@gnu.org> 2022-11-29 Jacob Bachmeyer <jcb@gnu.org>
* dejagnu.h (TestState::note): New method, like C note().
* doc/dejagnu.texi (C++ unit testing API): Add note() method.
* doc/dejagnu.texi (C++ unit testing API): Fix incorrect * doc/dejagnu.texi (C++ unit testing API): Fix incorrect
documentation. The C and C++ interfaces share the same global documentation. The C and C++ interfaces share the same global
counters, as do all C++ TestState objects. counters, as do all C++ TestState objects.

5
dejagnu.h

@ -255,6 +255,11 @@ class TestState {
std::cout << "\t" << outstate[UNSUPPORTED] << s << std::endl; std::cout << "\t" << outstate[UNSUPPORTED] << s << std::endl;
} }
void note (std::string s)
{
std::cout << "\t" << "NOTE: " << s << std::endl;
}
void totals (void) void totals (void)
{ {
std::cout << "\t#passed:\t\t" << passed << std::endl; std::cout << "\t#passed:\t\t" << passed << std::endl;

8
doc/dejagnu.texi

@ -2666,6 +2666,14 @@ counters and the @code{totals} method is automatically called when a
The @code{TestState} class supports the following instance methods: The @code{TestState} class supports the following instance methods:
@itemize @itemize
@item
@code{note} emits a note that will be displayed at verbose level 2 or
higher.
@quotation
@t{@b{TestState::note}(@i{msg});}
@end quotation
@item @item
@code{pass} prints a message for a successful test completion. @code{pass} prints a message for a successful test completion.

Loading…
Cancel
Save