Can TESTs be embedded in procedural code

0 views
Skip to first unread message

pschwenn

unread,
Dec 16, 2009, 7:37:32 PM12/16/09
to Google C++ Testing Framework
Googletesters,

When I try to embed a test in procedural C++ code, the compiler takes
offense.

The (VS2008) compiler won't accept any procedural C++ code wrapped
around a TEST presumably because there's no Class context around that
code. When I try to wrap that code itself with a dummy class or, or
with a function, the compiler complains that some static declaration
inside the embedded TEST cannot be included in the wrapping dummy
class.

What I'm trying to do is to sidestep the complexities and restrictions
of Value Parameterized TESTs and directly include TESTS within
parameter varying C++ procedural code -- to reuse the TEST so to
speak.

Does anyone know how to make it work (or that it can't be made to
work?). Or have a relevant suggestion?

Peter Schwenn

Reply all
Reply to author
Forward
0 new messages