summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-04-13 00:13:49 +0200
committerhut <hut@lavabit.com>2012-04-13 00:15:09 +0200
commit9cf43c171c81eb14037bf595f23642091ed1aa19 (patch)
treecb010b22ad4aae9ff667d5676625fe4d845ea157
parent654a81cacb2c8cf02d32c911fc87bc8d62fae698 (diff)
downloadranger-9cf43c171c81eb14037bf595f23642091ed1aa19.tar.gz
test rifle when running "make test"
-rw-r--r--Makefile2
-rwxr-xr-xranger/ext/rifle.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c5818ee9..20cf6f25 100644
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ doc: cleandoc
 test:
 	@for FILE in $(shell grep -IHm 1 doctest -r ranger | cut -d: -f1); do \
 		echo "Testing $$FILE..."; \
-		PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
+		RANGER_DOCTEST=1 PYTHONPATH=".:"$$PYTHONPATH ${PYTHON} $$FILE; \
 	done
 
 man:
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index 59351095..c0658c17 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -339,4 +339,8 @@ def main():
 
 
 if __name__ == '__main__':
-	main()
+	if 'RANGER_DOCTEST' in os.environ:
+		import doctest
+		doctest.testmod()
+	else:
+		main()