??????????????????4
???????????? ???????[ 2013/8/7 13:26:40 ] ????????
????????: gcc -o testcppunit testcppunit.cpp -lcppunit (?????VC/windows????????cl ????gcc--????????cl????????????????cmd???????????)
??shell????./testcppunit ????н??:
Test::testHelloWorldHello??world!
:OK
3 ?ЩCppUnit??????
1)CppUnit???????(core)
??????????:Test??TestFixture??TestCase??TestSuite
???????????SychronizedObject??TestListener??TestResult
??????:TestFailure??SourceLine??Execption??NotEqualException
????:Asserter??TestAssert
2)???????(Ouput)
????????:Outputter??TestResultCollector
??????:TestOutputter??CompilerOutputer??XmlOutputer
3)????????(Helper)
TypeInfoHelper??TestFactory??TestFactoryRegistry??NamedRegisters??TestSuiteFactory??
TesSuiteBuilder??TestCaller??AutoRegisterSuite??HelperMacros.
4)???????(Extension)
TestDecorator??RepeatedTest??Orthodox??TestSetUp
5)?????????(Listener)
TestSucessListener??TextTestProgressListener??TextTestResult
6)???沿??(UI)
TestRunner(TextUI??MfcUI??QtUI)
7)???(Portabilty):OStringStream
4 ????????CppUnit???Щ????????
a)CppUnit ??????????:https://www.ibm.com/developerworks/cn/linux/l-cppunit/
b)CppUnit???????:http://morningspace.51.net/resource/cppunit/cppunit_anno.html
???а??????????????????????????doc?????????:http://wenku.baidu.com/view/b7fcad4bcf84b9d528ea7ae1.html
c)???????л????????????CppUnit???????????????????????????????.
d)?????????????CppUnit??????example???????????
????5. ???--????CppUnit 1.21.1??????????????
??????????????????????????readme???????н?????????INSTALL??FAQ??TODO??????н???????????????????????
????????????ο?[3] ???н????????ldconfig????---????????/etc/ld.so.confl?????????????????????????????????·????????ο?[3]????????????????????”???/etc/ld.so.conf???(????????·??)?????/usr/local/lib???????????????·??“?????????/etc/ld.so.conf.d/*.conf???????????/usr/local/lib·????
????????????????????:”make install??а??????????/usr/include??????????????????????????include?????cppunit???????/usr/include????????????????????д???”??????????
????sudo cp -r cppunit /usr/include --- ?????????????????????????locate?????? /usr/local/iinclude?з?????cppunit????
?????????ο?[4]????????????????????????????????????????????????????????????????а??libdl.so????????????libc6??libc6-dev(???sudo apt-get install xxx)?????????????????????????(??????????)?????????????Linux???а??·??????????/lib/i386-linux-gun/?·?????libdl.so.2??????????????????????·????????????????????????????????libdl??
/*Program:testlibdl.c -- this example test weather the libdl.so.2 is work or not*/
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
int main(int argc?? char **argv) {
void *handle;
double (*desk)(char*);
char *error;
handle = dlopen ("/lib/libc.so.6"?? RTLD_LAZY);
if (!handle) {
fputs (dlerror()?? stderr);
exit(1);
}
desk= dlsym(handle?? "Apply");
if ((error = dlerror()) != NULL) {
fputs(error?? stderr);
exit(1);
}
dlclose(handle);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11