E D R , A S I H C RSS

Cpp Unit

C++ μ—μ„œ UnitTestλΌ ν•˜κΈ° μœ„ν•œ UnitTestFramework. http://sourceforge.net/projects/cppunit/ μ—μ„œ λ‹€μš΄ 받을 수 μžˆλ‹€.
C++ 의 λ˜λ‹€λ₯Έ ν˜•νƒœμ˜ UnitTestFramework 둜 CxxTest κ°€ μžˆλ‹€.

VC 7.0 용 μ„ΈνŒ… ν™”λ©΄ λ“€λ§Œ μΆ”κ°€ν•©λ‹ˆλ‹€. --NeoCoin

이곳에 VS2005용 μ„정방법을 κ°„λ‹¨ν•˜κ²Œ 정리해둠. - μž„μΈνƒ
----

1. μ„μΉ˜

Visual C++ 6.0 κΈ°μ€μœΌλ‘œ μ„λͺ…ν•œλ‹€. λ‹€λ₯Έ 언어듀에 λΉ„ν•΄ ν™˜κ²½μ„정을 μœ„ν•΄ ν•΄μ•Ό ν•  뢀뢄이 많으λ€λ‘œ 인내심을 가지고 따라해야 ν•œλ‹€.

1.1. μ€λΉ„ 1 - λ‹€μš΄ λ°›κ³  ν•œλ²ˆ 이상 κΌ­ ν•΄μ£Όμ–΄μ•Ό ν•  사항

1.1.1. Library 화일 μƒμ„±ν•˜κΈ°

처음 압좕화일을 λ°›κ³  ν’€λ©΄ lib 폴더에 Library κ΄€λ ¨ 화일듀이 μ—†λ‹€. 이것을 λ§Œλ“œλŠ” 방법

  • Library 화일 생성 : ~cpp ...cppunitexamplesexamples.dsw 을 μ—°λ’€ ~cpp WorkSpace 의 ~cpp FileView μ—μ„œ ~cpp CppUnitTestApp files 에 Set as Active Project둜 맞좰μ€λ‹€.(κΈ°λ³Έκ°’μœΌλ‘œ λ˜μ–΄ μžˆλ‹€.) 그리고 컴파일 ν•΄μ£Όλ©΄ lib 폴더에 library 화일듀이 생성될 것이닀.
컴파일 ν›„ μ‹€ν–‰ν•΄ 보면 λ‹€μŒκ³Ό 같은 (ν˜Ήμ€ λΉ„μŠ·ν•œ) κ²°κ³ΌλΌ λ³Όμˆ˜ μžˆλ‹€.
μ΄λ‘œμ„œ κ°€μž₯ 기본이 λ˜λŠ” μ…‹νŒ…μ€ μ™„λ£Œλœλ‹€.

1.2. μ€λΉ„ 2 - CppUnit을 μ‚¬μš©ν•  ν”„λ‘œμ νŠΈ μ—΄ λ•Œ ν•΄μ£Όμ–΄μ•Ό ν•  κΈ°λ³Έ μ„ΈνŒ…

1.2.1. include, library directory 맞좰주기 (λ‘˜μ€‘ ν•˜λ‚˜λΌ μ„ νƒν•œλ‹€.)

Library : ~cpp ...cppunit-x.x.xlib

Include : ~cpp ...\cppunit-x.x.xinclude
  1. 전체 μ„ΈνŒ… λ³€κ²½μ‹œ
    1. Tools -> Options -> Directories -> Include files μ—μ„œ ν•΄λ‹Ή cppunit
    2. Tools -> Options -> Directories -> Library files μ—μ„œ μ—­μ‹œ lib
  2. ν•΄λ‹Ή ν”„λ‘œμ νŠΈμ—λ§Œ μ μš©μ‹œ
    1. Project -> Settings -> C/C++ -> Preprocessor -> Additional include directories
    2. Project -> Settings -> Link -> Input -> Additional Library directories

  1. RTTI λΌ μ²΄ν¬ν•΄μ€λ‹€.
  2. Project Setting - Link - General - object/library 에 cppunitd.lib, testrunnerd.lib λΌ μΆ”κ°€ν•΄μ€λ‹€.
  3. ν•΄λ‹Ή ν”„λ‘œμ νŠΈκ°€ μžˆλŠ” 곳의 debug λ“±μ˜ 디렉토리에 ν•΄λ‹Ή lib 디렉토리에 μžˆλŠ” testrunnerd.dll 을 볡사해μ€λ‹€. μ΄λŠ” Project Setting - Post-Build-step 의 Post-build-command 에 λ‹€μŒμ„ μΆ”κ°€ν•΄μ£Όλ©΄ 컴파일 ν• λ•Œλ§ˆλ‹€ dll 화일을 μžλ™μœΌλ‘œ 볡사해μ€λ‹€.

~cpp 
copy c:cppunitlibtestrunnerd.dll .
  • Project Setting - Code Generation - Use Run-Time library λΌ λ‹€μŒμœΌλ‘œ 맞좰μ€λ‹€.
    • Release Mode : Mulithreaded DLL
    • Debug Mode : Debug Multihreaded DLL
  • app ν΄λž˜μŠ€μ— λ‹€μŒκ³Ό 같은 runner 싀행을 μœ„ν•œ μ½”λ“œλΌ μΆ”κ°€ν•œλ‹€. λ‹€μŒ μ½”λ“œλΌ μΆ”κ°€ν•¨μœΌλ‘œμ¨ ν”„λ‘œκ·Έλž¨ μ‹€ν–‰μ‹œμ— GUI Test Runner κ°€ μ‹€ν–‰λœλ‹€.

~cpp 
#include <msvc6/testrunner/testrunner.h>
#include <cppunit/extensions/testfactoryregistry.h>
.
.
.
BOOL CMyApp::InitInstance () {
.
.
    // Dialog Based 의 κ²½μš°λŠ” dlg.DoModal ()을 μ‹€ν–‰ν•˜κΈ° 전에 적어μ€λ‹€.
    TestRunner  runner;
    runner.addTest ( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
    runner.run ();
}

2. UnitTest TestCase의 μž‘μ„±

Test Case κ°€ 될 ClassλŠ” ~cpp CppUnit::TestCase λΌ μƒμ†λ°›λŠ”λ‹€.

2.1. ExampleTestCase.h

~cpp 
#ifndef CPP_UNIT_EXAMPLETESTCASE_H 
#define CPP_UNIT_EXAMPLETESTCASE_H 
 
#include <cppunit/TestCase.h> 
#include <cppunit/extensions/HelperMacros.h> 
 
class ExampleTestCase : public CppUnit::TestCase 
{ 
  CPPUNIT_TEST_SUITE( ExampleTestCase );      // TestSuite
  CPPUNIT_TEST( testExample );                // TestCase 의 등둝.
  CPPUNIT_TEST_SUITE_END();                   // TestSuite 의 끝. μ΄λ‘œμ„œ ν•΄λ‹Ή Test Case 에 μžλ™μœΌλ‘œ suite λ©”μ†Œλ“œκ°€ λ§Œλ“€μ–΄μ§„λ‹€.
protected: 
        void                    testExample (); 
public: 
        void                    setUp (); 
        void                    tearDown (); 
}; 
#endif 

2.2. ExampleTestCase.cpp

~cpp   
#include "stdafx.h"                      // MFC 인 경우.
#include "hostapp.h"                     // MFC 인 경우 ν•΄λ‹Ή App Class
#include "ExampleTestCase.h" 
 
CPPUNIT_TEST_SUITE_REGISTRATION( ExampleTestCase );      // TestSuite λΌ λ“±λ‘ν•˜κΈ°. TestRunner::addTest κ°€ ν•„μš”μ—†λ‹€.
 
 
void ExampleTestCase::testExample ()     // ν…ŒμŠ€νŠΈ ν•˜λ €λŠ” ν•¨μˆ˜.
{ 
        CPPUNIT_ASSERT (1 == 2); 
} 
 
void ExampleTestCase::setUp ()          // fixture κ΄€λ ¨ μ…‹νŒ… μ½”λ“œ. 
{ 

} 

void ExampleTestCase::tearDown ()       // fixture κ΄€λ ¨ μ…‹νŒ… μ½”λ“œ.
{ 

} 
 
~cpp 
#include <iostream> 
using namespace std;

#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/TextTestResult.h>

#ifndef _SIMPLE_H_
#define _SIMPLE_H_

#include <cppunit/TestCase.h>
#include <cppunit/extensions/HelperMacros.h>

class SimpleTest : public CppUnit::TestFixture { 
public: 
	CPPUNIT_TEST_SUITE( SimpleTest );
	CPPUNIT_TEST ( testOne );
	CPPUNIT_TEST ( testTwo );
	CPPUNIT_TEST_SUITE_END();

	void testOne () {
		CPPUNIT_ASSERT( 1 == 2 );
		CPPUNIT_ASSERT( 3 == 4 );
	}

	void testTwo () {
		CPPUNIT_ASSERT( 1 == 1 );
		CPPUNIT_ASSERT( 3 == 3 );
	}

};

#endif

int main( int argc, char* argv[] )
{
	CppUnit::TextUi::TestRunner runner;
	CppUnit::TextTestResult result;
	
	runner.addTest (SimpleTest::suite());
	
	runner.run("", false);

	return 0;
}

2.2.1. GUI Test Runner 의 이용

GUI Programming 을 ν•˜κΈ° μœ„ν•΄ winmain 이 μ‹œμž‘μΈ μ½”λ“œμ˜ 경우(MFC GUI Programming 포함) μ½˜μ†”μ°½μ΄ λœ¨μ§€ μ•ŠλŠ”λ‹€. 이 경우 GUI Runner λΌ μ‹€ν–‰ν•΄μ€˜μ•Ό ν•œλ‹€.
~cpp 
#include <cppunit/ui/text/TestRunner.h>
λΌ
~cpp 
#include <cppunit/ui/mfc/TestRunner.h> 
둜 μˆ˜μ •ν•œλ’€, testrunnerd.dll λΌ ν•΄λ‹Ή ν”„λ‘œμ νŠΈν™”μΌμ— 볡사해주면 λœλ‹€.

Runner μ‹€ν–‰μ½”λ“œλŠ” λ‹€μŒκ³Ό 같이 MFC UI 의 Test Runner λΌ μ΄μš©ν•œλ‹€.
~cpp 
	CppUnit::MfcUi::TestRunner runner;
	CppUnit::TextTestResult result; 
	
	runner.addTest (SimpleTest::suite()); 
	
	// runner.run("", false); 
	runner.run();

2.2.2. Win32 API or Console ν”„λ‘œκ·Έλž˜λ°μ‹œ

Win API Programming μ‹œμ— Text Runner λΌ μ΄μš©ν•˜μ—¬ 이용 κ°€λŠ₯. λ‹€μŒκ³Ό 같은 μ‹μœΌλ‘œ μ“Έ μˆ˜λ„ μžˆλ‹€.
~cpp 
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE, LPSTR, INT) {

	CppUnit::TextUi::TestRunner runner;

	CppUnit::OStringStream stream;
	CppUnit::TextOutputter* outputter = new CppUnit::TextOutputter(&runner.result(), stream);

	runner.setOutputter(outputter);	

	runner.addTest(SimpleTest::suite());

	runner.run();

	MessageBox(NULL, stream.str().c_str(), "Test", MB_OK);	

	return 0;
}


~cpp 
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>

class SimpleTestCase : public CppUnit::TestCase {
public:
	CPPUNIT_TEST_SUITE ( SimpleTestCase );
	CPPUNIT_TEST(testOne);
	CPPUNIT_TEST(testTwo);
	CPPUNIT_TEST_SUITE_END();
public:
	void testOne() {
		CPPUNIT_ASSERT_EQUAL(10,10);
	}
	void testTwo() {
		CPPUNIT_ASSERT_EQUAL(20,20);
	}
};
CPPUNIT_TEST_SUITE_REGISTRATION (SimpleTestCase);

int main() {
	CppUnit::TextUi::TestRunner runner;
	CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
	runner.addTest(registry.makeTest());
	runner.run();

	return 0;
}

2.2.3. assertEqual 의 이용

μ½”λ“œλΌ λ³΄λ©΄ μ•Œκ² μ§€λ§Œ, ASSERT 문듀에 λŒ€ν•΄μ„œ μ „λΆ€ λ§€ν¬λ‘œλΌ μ΄μš©ν•œλ‹€. 만일 μ΄λΌ λ‹€λ₯Έ μ–Έμ–΄λ“€μ˜ UnitTest Framework 처럼 assertEqual μ΄λ‚˜ assert 문으둜 μ“°κ³  μ‹Άλ‹€λ©΄, λ‹€μŒμ˜ λ¬Έμž₯을 cppunit library λΌ include ν•˜κΈ°μ „μ— μΆ”κ°€ν•΄μ€λ‹€.
~cpp 
#define CPPUNIT_ENABLE_NAKED_ASSERT 1

기타 μžμ„Έν•œ λ‚΄μš©λ“€μ€ (flag λ“€) cppunit/portability.h λΌ μ°Έμ‘°ν•˜λ©΄ λœλ‹€.

2.2.4. 주의점

  • 초기 μ€λΉ„ν• λ•Œ μ‚½μ§ˆν•˜λŠ” κ²½μš°κ°€ λ§Žλ‹€. -_-; CppUnit 의 κ²½μš°λŠ” ν—€λ”ν™”μΌλ“€μ˜ include μˆœμ„œλ“€μ΄ μ€‘μš”ν•˜λ‹€. 그리고 MFC 의 κ²½μš°λŠ” stdafx.h λΌ κ°κ°μ˜ ν™”μΌλ“€λ§ˆλ‹€ include ν•΄μ€˜μ•Ό ν•œλ‹€. (APIμ—μ„œ CppUnit λŠ” 어떨지 κΆκΈˆν•΄μ§„λ‹€.)
  • 쀑간쀑간에 Rebuild ν•΄μ„ ν•„μš”κ°€ μžˆλ‹€. (μ œλŒ€λ‘œ ν–ˆλ‹€κ³  μƒκ°ν–ˆλŠ”λ° Test Caseκ°€ Failure κ°€ λ‚˜λŠ” κ²½μš°μ—λŠ” ν•œλ²ˆ μ˜μ‹¬ν•  ν•„μš”κ°€ μžˆλ‹€.)
----
MSVCμ—μ„œ μ—λŸ¬κ°€ λ‚˜λŠ” 경우 λŒ€λΆ€λΆ„μ€ CppUnit FAQλΌ μ°Έκ³ ν•˜λ©΄ ν•΄κ²°ν•  수 μžˆλ‹€. http://cppunit.sourceforge.net/FAQ


~cpp 
2) Questions related to Microsoft Visual VC++

2.1) Why does my application crash when I use CppUnit?
   
   You probably forgot to enable RTTI in your project/configuration. RTTI are disabled by default. 
   Enable RTTI in Projects/Settings.../C++/C++ Language. Make sure to do so for all configurations.

2.2) Why does the compiler report an error when linking with CppUnit library?

   You most likely are not using the same C-RunTime library as CppUnit.
   In Release configuration, CppUnit use "Mulithreaded DLL".
   In Debug configurations, CppUnit use "Debug Multihreaded DLL".
   Check that Projects/Settings.../C++/Code Generation is indeed using the correct library.

----
1.9.10 버전을 κΈ°μ€μœΌλ‘œ VC++ 7.0 (VS.NET) ν™˜κ²½ μ„ΈνŒ…μ„ 보인닀.

2.2.5. μ€λΉ„ - 1 lib, dll λ§Œλ“€κΈ°

1.9.10 은 sf.net 에 릴리즈 λ˜μ–΄ μžˆμ§€ μ•Šλ‹€.
http://cppunit.sourceforge.net/snapshot/ μ—μ„œ λ°›μ•„μ˜¬μˆ˜ μžˆλ‹€.
CppUnitCompile0.GIF
VC++ 6.0 νŒŒμΌμ„ λ°›μœΌλ©΄
CppUnitCompile2.GIF
μ΄λ ‡κ²Œ λ³€ν™˜λ˜μ–΄ 컴파일 κ°€λŠ₯ν•˜λ‹€. λ‘κ°œμ˜ ν”„λ‘œμ νŠΈκ°€ μ—λŸ¬λ‚¨, ν•˜μ§€λ§Œ dll, lib μƒμ„±μ—λŠ” 지μž₯μ—†μŒ
CppUnitCompile3.GIF
λ‹€μŒκ³Ό 같은 νŒŒμΌλ“€μ„ Test CaseλΌ μž‘μ„±ν•  ν”„λ‘œκ·Έλž¨μ— ν•„μš”ν•˜λ‹€.

2.2.6. μ€λΉ„ - 2 TestCase λ§Œλ“€κΈ°λΌ μœ„ν•œ μ„ΈνŒ…

CppUnitSettigDirectory0.GIF
λ‹€μŒκ³Ό 같은 디렉토리 μƒνƒœλΌκ³  κ°€μ •ν•œλ‹€.
CppUnitSettigInclude0.GIF
Include μ‹œμΌœμ•Όν•  디렉토리 μΆ”κ°€(cppuint src λ“€μ–΄ 있음)
CppUnitSettigLib0.GIF
라이브러리 디렉토리 μ„ΈνŒ…
CppUnitSettigLib1.GIF
라이브러리 μΆ”κ°€
CppUnitSettigRuntime0.GIF
λŸ°νƒ€μž„ ν™˜κ²½ μ„ΈνŒ…
----
싱가폴 κ΅­λ¦½λŒ€ν•™μ˜ μ†Œν”„νŠΈμ›¨μ–΄ 곡학 ν”„λ‘œμ νŠΈ μˆ˜μ—…μ—μ„œ CppUnit을 μ‚¬μš©ν•˜κ³  μžˆλŠ”λ°, http://www.comp.nus.edu.sg/~cs3214s/tools/cppunitVC.html 에 κ°€λ©΄ MSVCμ—μ„œ CppUnit을 μ‚¬μš©ν•˜λŠ” 방법을 μ‰½κ²Œ μ„λͺ…ν•œ μ•ˆλ‚΄μ„œλΌ λ³Ό 수 μžˆλ‹€.
학ꡐ μˆ˜μ—…μ—μ„œ CppUnit κ³Ό CVSλΌ μ‹€μ œλ‘œ μ“΄λ‹€λŠ”κ²Œ μ‹ κΈ°ν•˜λ‹€λŠ”; --1002
학ꡐ μˆ˜μ—…μ—μ„œ μ‹€μ§ˆμ μ΄κ³  ν˜„μž₯μ—μ„œ 직접 μ“°μ΄λŠ” 도ꡬ듀을 μ‚¬μš©ν•˜λ„λ‘ μœ λ„ν•˜λŠ” 것이 정말 λΆ€λŸ½κ³ , κ΅­λ‚΄ ν”„λ‘œμ νŠΈ/μ‹€μŠ΅ μˆ˜μ—…μ—μ„œ κ·Έλƒ₯ ꡐ재의 챕터 ν•˜λ‚˜μ”© λ°œν‘œμ‹œν‚€κ³  μ΄λΌ μ§€μΌœλ³΄κ³ , ν‰κ°€ν•˜κ³ , 끝에 지엽적인 질문으둜 λ°œν‘œμž 골탕 λ¨Ήμ΄λŠ” 일 외에도, ꡐ수(ν˜Ήμ€ 쑰ꡐ)κ°€ ν•΄ μ„ μˆ˜ μžˆλŠ” 것이 μ΄λ ‡κ²Œ λ§Žλ‹€λŠ” 것이 μ‹ κΈ°ν•˜λ‹€λŠ”; --JuNe
  • vc7 용 cppunit 은 μ—†λ‚˜μš”.? ν™˜κ²½μ΄ λ„ˆλ¬΄ 많이 λ°”λ€Œμ–΄μ„œ μ €κ±Έ μ μš©ν•˜λ €λ‹ˆκΉŒ νž˜λ“œλ„μš”..-_- (μΈμŠ€ν†¨ λ„νλ¨ΌνŠΈ λ³΄λ‹ˆκΉŒ μ΅œμ†Œ 6.0이라고 λ‚˜μ™€μžˆκΈ°λŠ” ν•˜λ˜λ°..) μž„μΈνƒ
    vc7 도 λ˜‘κ°™μ΄ ν•˜λ©΄ 됨. 단, ν”„λ‘œμ νŠΈμ˜ 라이브러리 μ„정이 vc7 의 λ‹€λ₯Έ 메뉴에 μžˆμ–΄μ„œ 그렇지. --1002
  • μ „ "Project Setting - Link - General - object/library 에 cppunitd.lib, testrunnerd.lib λΌ μΆ”κ°€ν•΄μ€λ‹€."라고 ν•΄μ„œ μΆ”κ°€ ν•΄μ€¬λ”λ‹ˆ
linking...
LINK : fatal error LNK1104: cannot open file "cppunitd.lib,"
Error executing link.ex

라고 linkμ—λŸ¬κ°€ λ‚˜λŠ”λ° μ™œ κ·Έλ ‡μ£ ? 흐 무척 μ‚½μ§ˆν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.-- FredFrith

library path 문제일 것 κ°™μ€λ°μš”. μ•„λ‹ˆλ©΄, CppUnit 이 컴파일 λ˜μ–΄μžˆλŠ”μ§€ 확인해야 할것 κ°™μŠ΅λ‹ˆλ‹€. (lib 디렉토리에 cppunitd.lib 화일이 μžˆλŠ”μ§€ 확인) --1002

  • VC6μ—μ„œ μž‘μ—…ν•˜κ³  μžˆλŠ”λ°μš”. CFileDialogλΌ ν†΅ν•΄ 파일 pathλΌ λ°›μœΌλ €κ³  ν•˜λŠ”λ°, TestRunnerκ°€ CFileDialog λͺ…령을 μˆ˜ν–‰ν•˜λŠ” 것보닀 λ¨Όμ € λ™μž‘ν•΄ 파일 κ²½λ‘œλΌ λ°›μ„ 수 μ—†μŠ΅λ‹ˆλ‹€.. TestRunnerκ°€ μ‹€ν–‰λ˜λŠ” μ‹œμ μ„ μ‘°μ ˆν•  수 μžˆλ‚˜μš”? --FredFrith
μ–΄λ– ν•œ 뢀뢄을 ν…ŒμŠ€νŠΈν•˜κ³  μ‹ΆμœΌμ‹ κ±΄μ§€ κΆκΈˆν•©λ‹ˆλ‹€. (ν…ŒμŠ€νŠΈ λŒ€μƒμ΄ λ˜λŠ” μ½”λ“œλΆ€λΆ„κ³Ό ν…ŒμŠ€νŠΈ μ½”λ“œλΌ λ³΄μ—¬μ£Όμ‹œλ©΄ μ€ λ” 도움이 될λ“ν•©λ‹ˆλ‹€.) --1002

* 곡간이 쒁아 μ „λΆ€ μ˜¬λ¦¬κΈ°κ°€ νž˜λ“ λ°, file upload ν•  μˆ˜λŠ” μ—†λ‚˜μš”? -- FredFrith

* μ›Ήμ„œν•‘μ„ 톡해 이곳에 μ™”μŠ΅λ‹ˆλ‹€. μœ„μ—μ„œ ExampleTestCase ν΄λž˜μŠ€μ™€ SimpleTestμ™€μ˜ κ΄€κ³„λŠ” μ–΄λ–»κ²Œ λ©λ‹ˆκΉŒ?
mainμ—μ„œλŠ” ExampleTestCaseλΌ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ”λ°μš”...

Win32 APIν™˜κ²½μ—μ„œ MFC TestRunnerλΌ μ‚¬μš©ν•˜λŠ” 방법을 μ°Ύμ•˜μœΌλ©΄ μ’‹κ² κ΅°μš”. μ—¬λŸ¬κ°€μ§€λ‘œ μ‹œλ„ν•΄λ³΄μ•˜λŠ”λ° MFC에 λŒ€ν•œ 지식이 λ„ˆλ¬΄ λΆ€μ±ν•΄μ„œ 계속 μ‹€νŒ¨ν•˜λ„μš”. --이응μ€

GUI Runner λ§μ”€μ΄μ‹ κ°€μš”? μ‹€ν—˜ μ€ ν•΄λ³΄κ³  λ¦¬ν”Œν•˜κ² μŠ΅λ‹ˆλ‹€. --1002

이 뢀뢄에 λ‚˜μ˜€λŠ” Code Generation뢀뢄이 어디에 μžˆλŠ”μ§€ μ°Ύμ§€λΌ λͺ» ν•˜κ² λ„μš”. 메뉴가 μˆ¨μ–΄μžˆκΈ°λΌλ„ ν•œ 건지...@-@;; --leoanrdong
~cpp 
Project Setting - Code Generation - Use Run-Time library λΌ λ‹€μŒμœΌλ‘œ 맞좰μ€λ‹€. 

Release Mode : Mulithreaded DLL 

Debug Mode : Debug Multihreaded DLL 
- C/C++ 탭에 보면 categoryκ°€ μžˆλŠ”λ° 거기에 code generation 이 μžˆμŠ΅λ‹ˆλ‹€. - μž„μΈνƒ
κ³ λ§ˆμ›Œμš”. ν•΄κ²°ν•˜κ³  이제 돌릴 수 있λ„μš” :) -Leonardong

또 이 뢀뢄은 μ œλŒ€λ‘œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” λ“ ν•˜λ„μš”. 볡사가 μ•ˆ λ˜μ–΄λ„ μž‘λ™μ€ ν•˜λ‹ˆκΉŒ μ•„μ§κΉŒμ§€ λ¬Έμ œλŠ” μ—†μŠ΅λ‹ˆλ‹€λ§Œ;;-Leonardong
~cpp 
copy c:cppunitlibtestrunnerd.dll .

μ•„λž˜ 두 뢀뢄을 μƒˆ ν”„λ‘œμ νŠΈ μƒμ„±μ‹œ μžλ™μœΌλ‘œ μΆ”κ°€λ˜κ²Œ ν•˜λŠ” 쒋은 방법 μ—†λ‚˜μš”. 맀번 ν•˜λ €λ‹ˆ λΆˆνŽΈν•˜λ„μš”; -- ν™©μž¬μ„ 
{{|
Project Setting - Link - General - object/library 에 cppunitd.lib, testrunnerd.lib λΌ μΆ”κ°€ν•΄μ€λ‹€.
~cpp 
copy c:cppunitlibtestrunnerd.dll .
|}}
----
kldp.net 에 c λΌ μœ„ν•œ UnitTest Framework ν”„λ‘œμ νŠΈκ°€ μžˆμ—ˆλ„μš”. http://kldp.net/projects/act/
----
UnitTest
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:02
Processing time 0.0613 sec