Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Cov++ÔÚLinuxϼòµ¥Ê¹Óà Èí¼þ¸²¸ÇÂʹ¤¾ß


Covtool
ÊÇÒ»¸öÓöÔ
C++
´úÂë½øÐÐÔËÐÐʱ¸²¸ÇÂʼì²éµÄ¹¤¾ß£¬¿ÉÒÔÒÔÐÐΪµ¥Î»¼ì²é³öÄÇЩ´úÂëÔÚÔËÐÐÖб»Ê¹Óã¬ÄÇЩûÓÐʹÓá£
1.      
°²×°
make
make tests
make install
½«
/usr/local/covtool
Ìí¼Óµ½
PATH
½«
/usr/local/covtools
Ìí¼Óµ½
MANPATH£¨´Ë²½ºÜÖØÒª£¬ËüµÄman±ÈÎĵµ¿¿Æ׵öࣩ
ÎÒÒ»°ãÊÇÌí¼ÓÔÚ/etc/profileÖÐ
 
2.      
ʹÓÃ
Èç¹ûÊÇʹÓÃ
makefile
£º
(1).
½«
g++
Ì滻Ϊ
cov++
¼´¿É¡£
(2).
ÖØÐÂ
build
(3).
ÔËÐÐËùÓеIJâÊÔ£¨Ç뾡Á¿È«µÄ²âÊÔ¸÷ÖÖÇé¿ö£©
(4).
ºÏ²¢
*.covexp
Îļþ£¨
cov++
ϵͳÉè¼ÆΪ¿ÉÒÔÔËÐжà´Î²âÊÔ³ÌÐòµÄ¸÷ÖÖÇé¿öÉú³É¶à¸ö
*.covexp
£¬È»ºó½«¶à´Î½á¹ûͳºÏÆðÀ´ÐγÉÒ»¸ö±¨¸æ£©£º
       
covmerge.exe find * -name ‘*.covexp’ –print
‘\
       
>merged.db
Í˳ö¡£
(5).
ÓÃ
*.db
ÎļþÉú³É
html
Îĵµ¡£
       
gen_html merged.db
(6).
Éú³ÉµÄÎĵµÔÚ
coverage_html
Ŀ¼ÏÂ
,
ÓÃä¯ÀÀÆ÷²é¿´
index.html
ÀýÈ磺
Files in
directory /home/lboggs/covtool/cov++_test
Percent
Coverged
Instrumented
Lines
Executed
Lines
Directory
Name
40
5
2
/home/lboggs/covtool/cov++_test/test1.c
40
5
2
/home/lboggs/covtool/cov++_test/test2.cxx
 
#include
<stdio.h>
 
 
    
void
function(int count)
+    
{
+    
  
if(count < 10)
-     
    
printf("too low\n");
 
    
  
else
+    
    
printf("ok!\n");
 
    
}
+
±íʾ´ËÐÐÔÚ²âÊÔÖб»Ö´ÐУ¬
-
±íʾ´ËÐÐÔÚ²âÊÔÖÐδִÐС£
 
3.
×¢Òâ
£º
      
(1).cov++
ĬÈϵÄ
c++
ÎļþÊÇ
*.c,
Èç¹ûÊÇ
*.cpp
µÄ»°Ê¹ÓÃÑ¡Ïî
-EXT:
             
À


Ïà¹ØÎĵµ£º

linuxÏÂjdkµÄ°²×°ºÍжÔØ

 Ò»¡¢ jdkµÄ°²×° 
 1. ÏÂÔØjdk£º ´Ówww.sun.comÏÂÔØjdk£¨ jdk-1_5_0_20-linux-i586-rpm.bin £©£¬ÏÂÔغóʹÓÃsshÉÏ´«µ½linuxϵͳµÄhomeĿ¼Ï£¬µ±È»Ò²¿ÉÒÔ·ÅÔÚÆäËüĿ¼¡£
 2. ½øÈ밲װĿ¼,ÐÞ¸ÄjdkµÄʹÓÃȨÏÞ,¸øËùÓÐÓû§Ìí¼Ó¿ÉÖ´ÐеÄȨÏÞ£º
#cd /home
#chmod +x jdk-1_5_0_20-linux-i586.rpm.bin ......

LinuxÏÂconfigureÃüÁî²ÎÊýµÄÏêϸ˵Ã÷

Linux»·¾³ÏµÄÈí¼þ°²×°£¬²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇé;Èç¹ûͨ¹ýÔ´´úÂë±àÒëºóÔÚ°²×°£¬µ±È»ÊÂÇé¾Í¸üΪ¸´ÔÓһЩ;ÏÖÔÚ°²×°¸÷ÖÖÈí¼þµÄ½Ì³Ì¶¼·Ç³£ÆÕ±é;µ«Íò±ä²»ÀëÆäÖУ¬¶Ô»ù´¡ÖªÊ¶µÄÔúʵÕÆÎÕ£¬°²×°¸÷ÖÖÈí¼þµÄÎÊÌâ¾ÍÓ­Èжø½âÁË¡£Configure½Å±¾ÅäÖù¤¾ß¾ÍÊÇ»ù´¡Ö®Ò»£¬ËüÊÇautoconfµÄ¹¤¾ßµÄ»ù±¾Ó¦Óá£
ÓëһЩ¼¼ÇÉÏà±È£¬ConfigureÏԵûù´¡Ò» ......

cygwin Ààlinux¿ª·¢»·¾³µÄÅäÖÃ


»¨ÁË°ëÌìÅäÖúÃÁËcygwinµÄ½çÃ棬 ÏÂÃæ×öÒ»¼Í¼£¬ÒÔ±¸Ï´βéÔÄ
1. ¹ØÓÚtermµÄÎÊÌ⣬ Èç¹ûÏÓ°²×°µÄterm²»¹»pp£¬¿ÉÒÔʹÓÃputty£¬ÄǾÍÐèÒª°²×°openssh°ü£¬ÒÔ±ã¿ÉÒÔʹÓÃputty£¬
opensshµÄ°²×°¹ý³Ì²ÎÔÄhttp://pigtail.net/LRP/printsrv/cygwin-sshd.html ÀïÃæ½éÉܵĺÜÏêϸ¡£ÏÂÃæÌô¼¸¸ö¹Ø¼üµã¼Ç¼ÈçÏ£º
(2b) Download ......

linux,¿ªÊ¼¡­¡­

×ܾõµÃÔÚITÐÐÒµÀï»ì£¬Ñ§±à³ÌÓïÑÔҪѧϰC²ÅÏñÑù£¬¿ª·¢ÒªÔÚLinuxϲÅÄÜ·¢»ÓºÃ£¬ºÇºÇ£¬Ëæ¿Ú˵µÄ£¬²»¹ý¸öÈËÈÏΪÏëÉîÈëµÄѧϰ¼ÆËã»ú֪ʶ£¬»¹ÊÇÓ¦¸ÃѧϰLinux²Ù×÷ϵͳ£¬ËùÒÔ´Ó½ñÌ쿪ʼÿÌì³é³öÒ»¸öСʱѧϰ£¬ÔÚ´Ë×öһЩѧϰ¼Ç¼£¬ÒÔ¹©ÒÔºó²éѯ×ܽᡣ
½ñÌìÊÇ°²×°£¬ÊÇÔÚVMwareÏ°²×°µÄRed hat 9,°²×°Ï൱˳³©£¬Ò»Â·nextÏÂÈ¥£¬¾ÍOKÁ ......

LinuxÐźÅÁ¿ ¹²ÏíÄÚ´æºÍÏûÏ¢¶ÓÁÐ

LinuxÐźÅÁ¿ ¹²ÏíÄÚ´æºÍÏûÏ¢¶ÓÁÐ
1. ÐźÅÁ¿
ʹÓÃÐźÅÁ¿¿ÉÒÔʵÏÖ½ø³Ì¼äͬ²½¡£Ö÷Òªº¯Êý¶¨Ò壺
#include <sys/sem.h>
int semctl(int sem_id, int sem_num, int command, …);
int semget(key_t key, int num_sems, int sem_flags);
int semop(int sem_id, struct sembuf *sem_ops, size_t num_sem_ops);
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ