Commits

Guido Draheim  committed 56a3442

allow single tests to be run

  • Participants
  • Parent commits 2c9b432

Comments (0)

Files changed (2)

 clean:
 	cd src && sudo python setup.py clean --build-base=$(BUILDDIR)
 	
-tests unittest check:
+tests unittest:
 	cd src && python setup.py build --build-base=$(BUILDDIR) \
-	   test
+	   test $(CHECK)
+check:
+	PYTHONPATH=src \
+	python src/tests/computer_test.py -v $(CHECK)
+test_%:
+	@ func=`grep "def $@" src/tests/computer_test.py \
+	    | sed -e "s/.*def  *//" -e "s/[(].*//" -e q` \
+	; test -z "$$func" && func="$@" \
+	; echo $(MAKE) check CHECK=DvbComputerTests.$$func \
+	;      $(MAKE) check CHECK=DvbComputerTests.$$func
+
 
 RPMROOT=$(shell pwd)/rpm
 BUILDDIR = $(RPMROOT)/build

File src/tests/computer_test.py

         if self.env is None:
             self.env = ComponentManager() 
         self.computer = DvbCronRecordingPlanComputer(self.env)
+        self.computer.logg = _logg
     def test_01_options(self):
         self.assertEqual("plan4", self.computer.algorithm, )
         self.assertTrue("3sat" in self.computer.rankup_channels)