summaryrefslogtreecommitdiff
path: root/Jamrules.jam
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-10 21:36:03 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-10 21:36:03 +0000
commit6db04f4320cd5d24ae625dbc1df5a8a71b93e51d (patch)
treee6e5c79464b4d4c05c75fd6dbb8f4d3e800edbcc /Jamrules.jam
parentab28c3b45e611b5d49a03024bd6ae7b184d37d4a (diff)
tests: Added simple test framework, added a couple of tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@140 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'Jamrules.jam')
-rw-r--r--Jamrules.jam27
1 files changed, 25 insertions, 2 deletions
diff --git a/Jamrules.jam b/Jamrules.jam
index 43d817f..4fda7f4 100644
--- a/Jamrules.jam
+++ b/Jamrules.jam
@@ -25,16 +25,21 @@ actions RunAction
$(>:\\)
}
-actions quietly ignore MakeDir
+actions quietly ignore MakeDirAction
{
mkdir $(<:\\) >nul 2>&1
}
+actions quietly ignore DeleteAction
+{
+ del /F $(>:\\) >nul 2>&1
+}
+
rule MakeFileDir TARGET
{
local DIR = $(TARGET:D) ;
- MakeDir $(DIR) ;
+ MakeDirAction $(DIR) ;
Needs $(TARGET) : $(DIR) ;
}
@@ -118,6 +123,21 @@ rule Application TARGET : SOURCES : LIBRARIES
$(TARGET)_objects = $(OBJECTS) $($(LIBRARIES)_objects) ;
}
+rule CleanCoverage TARGET
+{
+ # make target
+ local CLEAN_TARGET = $(TARGET)_clean_coverage ;
+
+ NotFile $(CLEAN_TARGET) ;
+ Always $(CLEAN_TARGET) ;
+ Depends $(TARGET) : $(CLEAN_TARGET) ;
+
+ # clean object files
+ local FILES = $($(SOURCE)_objects:S=.gcda) ;
+
+ DeleteAction $(CLEAN_TARGET) : $(FILES) ;
+}
+
rule Test TARGET : SOURCE
{
# make alias
@@ -128,6 +148,9 @@ rule Test TARGET : SOURCE
# remember executable objects for coverage
$(TARGET)_objects = $($(SOURCE)_objects) ;
+
+ # clean coverage files before run
+ CleanCoverage $(TARGET) ;
}
rule Coverage TARGET : SOURCE