?????????????е???????????????????????淶??????????????????????????????????????c/c++?????????Щ???????????????????????????? Java??.Net??php/python/perl/shell????????????Щ??????????????????????????????????????????????????Щ?????????????C++?????????β???????????????????????????????

?????????????÷???

??????Linux???c/c++??????????gcc/g++????????????????????????????????????????Makefile????Scons????????????????????????

???????????????? -fprofile-arcs -ftest-coverage ???? –coverage;

???????????????? -fprofile-arcs ???? –lgcov;

??????–g3 ??????-O2?????????????????;??????????????????Щ??????????к???????????и???????;

?????????????????????????????飬?????????????????????ò????????????????(???????????????????Ч??)???????makefile??????????????????????????????????makefile????????????

????ifeq ($(coverage)?? yes)

????CXXFLAGS += -fprofile-arcs -ftest-coverage

????LINKERCXX += -fprofile-arcs -ftest-coverage

????OPT_FLAGS = -g3

????endif

????????????????? make coverage=yes ????????Щ????????????????????????(scons???)??

?????????????

????????д???????????????????????????????????Rectangle.cpp?? RectangleTest.cpp?? Makefile??

????1)Rectangle.cpp ???????????漲?????????????Rectangle(??????)??????????????????

????set_values()?????ó????ζ????????;

????area()???????ε????;

????lenth()???????ε????;

????2)RectangleTest.cpp ??????????????????demo????????????cppunit/gtest???????????????????????main()??????????Rectangle????????;

????Rectangle.cpp??RectangleTest.cpp????????????