Browse Source

Makefile adaption for venv usage

master
Dirk Alders 3 years ago
parent
commit
a6e0b136ab
1 changed files with 26 additions and 9 deletions
  1. 26
    9
      scripts/Makefile

+ 26
- 9
scripts/Makefile View File

1
-COV2_CMD=python2-coverage
2
-COV3_CMD=python3-coverage
3
-PYT2_CMD=python2
4
-PYT3_CMD=python3
1
+COV2_CMD=venv2/bin/coverage
2
+COV3_CMD=venv3/bin/coverage
3
+PYT2_CMD=venv2/bin/python
4
+PYT3_CMD=venv3/bin/python
5
 PDF_CMD=xdg-open
5
 PDF_CMD=xdg-open
6
 
6
 
7
 OUTDIR=testresults
7
 OUTDIR=testresults
33
 smoke: testrun_smoke finalise compile status
33
 smoke: testrun_smoke finalise compile status
34
 single: testrun_single finalise compile status
34
 single: testrun_single finalise compile status
35
 
35
 
36
-clean:
37
-	@echo "\033[1;33mCleaning up unittest...\e[0m"
38
-	@echo "\e[1m  * Testresults from last testrun\e[0m"
36
+venv:
37
+	@[[ -d venv2 ]] || make venv2
38
+	@[[ -d venv3 ]] || make venv3
39
+
40
+venv2:
41
+	virtualenv -p /usr/bin/python2 venv2
42
+	venv2/bin/pip install --upgrade pip
43
+	venv2/bin/pip install -r requirements.txt
44
+venv3:
45
+	virtualenv -p /usr/bin/python3 venv3
46
+	venv3/bin/pip install --upgrade pip
47
+	venv3/bin/pip install -r requirements.txt
48
+
49
+clean: venv
50
+	@echo -e "\033[1;33mCleaning up unittest...\e[0m"
51
+	@echo -e "\e[1m  * Testresults from last testrun\e[0m"
39
 	@ls testresults | xargs -i echo "    testresults/{}"
52
 	@ls testresults | xargs -i echo "    testresults/{}"
40
 	@ls testresults | xargs -i rm -f "testresults/{}"
53
 	@ls testresults | xargs -i rm -f "testresults/{}"
41
-	@echo "\e[1m  * Collected coverage information\e[0m"
54
+	@echo -e "\e[1m  * Collected coverage information\e[0m"
42
 	@$(COV3_CMD) erase
55
 	@$(COV3_CMD) erase
43
 
56
 
57
+cleanall: clean
58
+	@echo -e "\e[1m  * Virtualenv\e[0m"
59
+	@rm -rf venv?
60
+
44
 release_testcases:
61
 release_testcases:
45
 	@$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
62
 	@$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases
46
 
63
 
47
-prepare:
64
+prepare: venv
48
 	@$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
65
 	@$(PYT3_CMD) src/unittest/scripts/unittest.py prepare
49
 
66
 
50
 testrun_full: clean prepare
67
 testrun_full: clean prepare

Loading…
Cancel
Save