From fca987525e5b6db7b4387f694122598f0a586576 Mon Sep 17 00:00:00 2001
From: deva <deva>
Date: Thu, 30 Jul 2009 09:55:24 +0000
Subject: Added automatically generated test section in cc files.

---
 tools/PracroAdd | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'tools/PracroAdd')

diff --git a/tools/PracroAdd b/tools/PracroAdd
index cbcdb64..c2ffdf0 100644
--- a/tools/PracroAdd
+++ b/tools/PracroAdd
@@ -57,6 +57,16 @@ function ccfile() {
   echo -n $hf >> $1;
   echo '"' >> $1;
   echo '' >> $1;
+
+  local hn=`echo $1 | cut -d'.' -f1 | tr 'a-z.' 'A-Z_'`
+  echo "#ifdef TEST_${hn}" >> $1;
+  echo "" >> $1;
+  echo "int main()" >> $1;
+  echo "{" >> $1;
+  echo "  return 0;" >> $1;
+  echo "}" >> $1;
+  echo "" >> $1;
+  echo "#endif/*TEST_${hn}*/" >> $1;
 }
 
 function hfile() {
-- 
cgit v1.2.3