|
我下载了cppunit-1.10.2在VC6.0 sp6下编译安装,通不过,大虾指点。
解压缩,打开src目录的源代码,Batach build -> Rebuild All,有如下的信息:
Build : warning : failed to (or don't know how to) build 'C:\CppUnit\src\msvc6\D
SPlugIn\Debug\TestRunnerDSPlugInD.dll'
接着通过Tools-->options设置include和lib目录,加入测试Add-ins,启用RTTI。
然后编译自己的实验代码(见后),报如下错误
d:\mytest\TestHelloWorld.cpp(12) : fatal error C1010: unexpected end of file whi
le looking for precompiled header directive
我的实验代码很简单
TestHelloWorld.h如下:
d:\mytest\TestHelloWorld.cpp(12) : fatal error C1010: unexpected end of file while looking for precompiled header directive
我的实验代码很简单
TestHelloWorld.h如下:
#if !defined(_TEST_HELLOWORLD_H_INCLUDED_)
#define _TEST_HELLOWORLD_H_INCLUDED_
#include "cppunit/extensions/HelperMacros.h"
class TestHelloWorld: public CppUnit::TestCase
{
public:
CPPUNIT_TEST_SUITE( TestHelloWorld);
CPPUNIT_TEST( HelloWorld );
CPPUNIT_TEST_SUITE_END();
void setUp();
void tearDown();
protected:
void HelloWorld(void);
};
#endif // !defined(_TEST_HELLOWORLD_H_INCLUDED_)
TestHelloWorld.cpp如下:
#include "TestHelloWorld.h"
CPPUNIT_TEST_SUITE_REGISTRATION(TestHelloWorld);
void TestHelloWorld:: setUp()
{}
void TestHelloWorld::tearDown()
{}
void TestHelloWorld::HelloWorld(void)
{
CPPUNIT_ASSERT(true);
} |
|