contentstorage/cahandler/tapp/tsrc/t_catapphandler/function_cov.pl
changeset 117 c63ee96dbe5f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/cahandler/tapp/tsrc/t_catapphandler/function_cov.pl	Thu Sep 16 12:11:40 2010 +0100
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Script for running branch coverage test
+#
+
+#USAGE:
+#    Usage: decision_cov.pl [-make=command]
+#    -make=instrument || run || ctcpost
+
+# import module
+use Getopt::Long;
+
+# read options
+my $make = "all";
+my $success = GetOptions ("make=s"   => \$make);
+
+if($make) {
+    if (($make eq "instrument") || ($make eq "all")) {
+
+		
+        system("del mon.sym");
+        system("del mon.dat");
+        system("del profile.txt");
+        system("rmdir /s /q CTCFUNCTION");
+        system("rmdir /s /q CTCDECISION");
+
+		chdir("../..");
+		
+        system("call qmake -config coverage");
+        system("call bldmake bldfiles");
+        system("call abld makefile winscw");
+        system("call abld reallyclean winscw");
+		
+        system('call ctcwrap -i f -C "EXCLUDE=*" -C "NO_EXCLUDE+./src/*" abld build winscw udeb');        
+		
+		chdir("tsrc/t_catapphandler");
+		system("call qmake -config coverage");
+        system("call bldmake bldfiles");
+        system("call abld test makefile winscw");
+        system("call abld test build winscw udeb");
+        
+        }
+    if (($make eq "run") || ($make eq "all")) {
+        system("call \\epoc32\\release\\winscw\\udeb\\t_catapphandler -o c:\\t_catapphandler.log");
+    }
+    if (($make eq "ctcpost") || ($make eq "all")) {
+		chdir("../..");
+        system("call ctcpost -ff -p profile.txt");
+        system("call ctc2html -nsb -i profile.txt -o tsrc/t_catapphandler/CTCFUNCTION");
+        system("call del profile.txt");
+        system("call ctcpost -fd -p profile.txt");
+        system("call ctc2html -nsb -i profile.txt -o tsrc/t_catapphandler/CTCDECISION");
+        system("call del profile.txt");
+    }
+}
+
+print "END.\n";