Hi Neto,
1) TestMain.h provides a mainloop. You don't have to use it, if you
want to have your own main().
Here is an example of a minimal main():
int main()
{
Pt::Unit::Application app;
std::ofstream fs("log.txt");
Pt::Unit::Reporter reporter(fs);
app.setReporter(reporter);
return app.run();
}
2) Implement a Unit::TestSuite and register at least one method.
Register the test with a RegisterTest object.
class MyTestSuite : public Pt::Unit::TestSuite
{
public:
MyTestSuite ()
: Pt::Unit::TestSuite("MyTestSuite ")
{
this->registerMethod( "Test1", *this, &MyTestSuite ::Test1);
}
void setUp()
{ }
void tearDown()
{ }
void Test1()
{ }
};
Pt::Unit::RegisterTest<MyTestSuite > register_MyTestSuite;
3) link against Pt-Unit
regards,
Marc
On 6 February 2011 10:00, Aloysius Indrayanto
<alo...@gm...> wrote:
> Hello,
>
> I don't think so. I think #include it will be enough.
>
> Try to refer to existing test such as the one inside the directory
> "Pt-Net/tests".
>
> Best regards,
> Aloysius
>
>
> On Sun, Feb 6, 2011 at 2:52 AM, Neto <cro...@gm...> wrote:
>> For use the Unit test of the Platinum Framework i have to edit the
>> TestMain.h ?
>>
>> ------------------------------------------------------------------------------
>> The modern datacenter depends on network connectivity to access resources
>> and provide services. The best practices for maximizing a physical server's
>> connectivity to a physical network are well understood - see how these
>> rules translate into the virtual world?
>> http://p.sf.net/sfu/oracle-sfdevnlfb
>> _______________________________________________
>> Pt-framework-general mailing list
>> Pt-...@li...
>> https://lists.sourceforge.net/lists/listinfo/pt-framework-general
>>
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> Pt-framework-general mailing list
> Pt-...@li...
> https://lists.sourceforge.net/lists/listinfo/pt-framework-general
>
|