锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产999精品久久久久久,伊人久久大香线蕉综合5g,久久99热这里只频精品6http://www.shnenglu.com/yeqing/category/2889.htmlzh-cnThu, 22 May 2008 23:31:47 GMTThu, 22 May 2008 23:31:47 GMT60- cpp unit鍦╨inux涓嬬殑瀹夎鍜岃皟璇?/title>http://www.shnenglu.com/yeqing/articles/14279.html澶滄瞾澶滄瞾Fri, 27 Oct 2006 06:50:00 GMThttp://www.shnenglu.com/yeqing/articles/14279.htmlhttp://www.shnenglu.com/yeqing/comments/14279.htmlhttp://www.shnenglu.com/yeqing/articles/14279.html#Feedback0http://www.shnenglu.com/yeqing/comments/commentRss/14279.htmlhttp://www.shnenglu.com/yeqing/services/trackbacks/14279.htmlOS錛歭inux
CppUnit錛歝ppunit-1.11.6
1銆佷笅杞姐佽В鍘?br />聽聽聽聽 鍒?/font>
http://sourceforge.net/projects/cppunit
涓嬭澆錛岀劧鍚庡鍒禼ppunit-1.11.6.tar.gz鍒?usr/src錛浡犅?
聽聽聽 榪愯錛歵ar -xf cppunit-1.10.2.tar.gz 瑙e帇緙╋紱鎴栬呭湪WIN涓嬬洿鎺ヨВ鍘?br />2銆佸畨瑁?br />榪涘叆cppunit-1.11.6鐩綍涓嬨備緷嬈¤繍琛屼笅鍒楀懡浠?br />聽聽聽聽聽 A 錛?/configure;聽聽
B 錛歮ake;
聽聽聽聽聽 C 錛歮ake check;
聽聽聽聽聽 D錛歮ake install
3銆佸凡緇廲opy *.h鏂囦歡.o, .a鏂囦歡宸茬粡瀹夎鍒?usr/local/lib涓幓浜嗭紝浣嗗ご鏂囦歡娌″畨瑁呭埌/usr/include涓幓
鎶奵ppunit-1.10.2鐨刢ppunit鐩綍澶嶅埗鍒?usr/include涓?br />4銆佸鍏ib
榪愯鏃惰鍏堣緗幆澧冨彉閲廘D_LIBRARY_PATH鍒癱ppunit鐨勫畨瑁呯洰褰曪紝涔熷氨鏄?usr/local/lib錛屽懡浠ゅ涓嬶細
聽聽聽聽聽聽 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
5銆佺紪鍐欐祴璇曠▼搴?br />testApp.cpp
#include <iostream>
聽
#include <cppunit/TestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
聽
聽
class Test : public CPPUNIT_NS::TestCase
{
聽CPPUNIT_TEST_SUITE(Test);
聽CPPUNIT_TEST(testHelloWorld);
聽聽 CPPUNIT_TEST_SUITE_END();
聽
聽public:
聽聽 void setUp(void) {}
聽聽 void tearDown(void) {}
聽
聽protected:
聽聽 void testHelloWorld(void) { std::cout << "Hello, world!" << std::endl; }
聽};
聽
聽CPPUNIT_TEST_SUITE_REGISTRATION(Test);
聽
聽int main( int argc, char **argv )
聽{
聽聽 // Create the event manager and test controller
聽聽 CPPUNIT_NS::TestResult controller;
聽
聽聽 // Add a listener that colllects test result
聽聽 CPPUNIT_NS::TestResultCollector result;
聽controller.addListener( &result );聽聽聽聽聽聽聽
聽
聽聽 // Add a listener that print dots as test run.
聽聽 CPPUNIT_NS::BriefTestProgressListener progress;
聽聽 controller.addListener( &progress );聽聽聽聽聽
聽
聽聽 // Add the top suite to the test runner
聽聽 CPPUNIT_NS::TestRunner runner;
聽聽 runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() );
聽聽 runner.run( controller );
聽
聽聽 return result.wasSuccessful() ? 0 : 1;
聽}
6銆佺紪璇戯紝榪愯
聽聽 鏈変袱縐嶆柟娉?br />聽聽聽 (a) 閾炬帴闈欐佸簱銆傜紪璇戝懡浠わ細
聽聽聽聽聽 g++ -L/usr/local/lib/libcppunit.a testApp.cpp -lcppunit -ldl -o testApp
聽聽聽 榪愯錛?br />聽聽聽聽聽 ./ testApp
聽聽聽 緇撴灉錛?br />聽聽聽聽 Test::testHelloWorldHello, world!
聽聽聽聽: OK
聽聽聽 (b) 閾炬帴鍔ㄦ佸簱銆傜紪璇戝懡浠わ細
聽聽聽聽聽聽 g++ testApp.cpp -lcppunit -ldl -o testApp
聽聽聽 鐒跺悗榪愯錛?br />聽聽聽聽聽聽 ./ testApp
聽聽聽 緇撴灉錛?br />聽聽聽 Test::testHelloWorldHello, world!
聽聽聽 : OK
7銆佸叾浠栦緥瀛?br />鍦╟ppunit-docs-1.11.6涓湁鏂囨。money_example.html錛岃鏂囨。璇︾粏鐨勪粙緇嶄簡嫻嬭瘯銆佸紑鍙戠殑榪囩▼錛?br />

]]>
2021精品国产综合久久|
中文字幕无码久久人妻|
人妻无码久久一区二区三区免费|
一本色道久久88综合日韩精品|
久久伊人五月丁香狠狠色|
热re99久久精品国99热|
久久综合综合久久狠狠狠97色88|
丁香久久婷婷国产午夜视频|
欧美日韩中文字幕久久久不卡|
蜜臀久久99精品久久久久久|
亚洲人成网亚洲欧洲无码久久|
九九99精品久久久久久|
香蕉99久久国产综合精品宅男自
|
久久综合中文字幕|
久久精品18|
青青草原精品99久久精品66|
色综合合久久天天综合绕视看|
少妇久久久久久被弄到高潮|
高清免费久久午夜精品|
亚洲欧美日韩久久精品|
久久91精品久久91综合|
久久国产劲爆AV内射—百度|
国产精品久久久天天影视香蕉
|
jizzjizz国产精品久久|
久久这里都是精品|
九九久久精品无码专区|
久久99亚洲网美利坚合众国|
伊人久久大香线蕉精品不卡|
久久久久久免费一区二区三区|
色综合久久无码中文字幕|
亚洲人成无码www久久久|
国产99久久久国产精品~~牛|
亚洲愉拍99热成人精品热久久
|
97久久超碰国产精品旧版|
日韩欧美亚洲国产精品字幕久久久
|
97精品国产91久久久久久|
精产国品久久一二三产区区别|
久久久久久青草大香综合精品|
26uuu久久五月天|
国产精品青草久久久久福利99|
国产精品久久久久无码av|