From a6e0b136ab98ef9293786e1a82781cf971e0690b Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 1 Aug 2021 21:49:40 +0200 Subject: [PATCH] Makefile adaption for venv usage --- scripts/Makefile | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 39ba404..4abc8b3 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,7 +1,7 @@ -COV2_CMD=python2-coverage -COV3_CMD=python3-coverage -PYT2_CMD=python2 -PYT3_CMD=python3 +COV2_CMD=venv2/bin/coverage +COV3_CMD=venv3/bin/coverage +PYT2_CMD=venv2/bin/python +PYT3_CMD=venv3/bin/python PDF_CMD=xdg-open OUTDIR=testresults @@ -33,18 +33,35 @@ short: testrun_short finalise compile status smoke: testrun_smoke finalise compile status single: testrun_single finalise compile status -clean: - @echo "\033[1;33mCleaning up unittest...\e[0m" - @echo "\e[1m * Testresults from last testrun\e[0m" +venv: + @[[ -d venv2 ]] || make venv2 + @[[ -d venv3 ]] || make venv3 + +venv2: + virtualenv -p /usr/bin/python2 venv2 + venv2/bin/pip install --upgrade pip + venv2/bin/pip install -r requirements.txt +venv3: + virtualenv -p /usr/bin/python3 venv3 + venv3/bin/pip install --upgrade pip + venv3/bin/pip install -r requirements.txt + +clean: venv + @echo -e "\033[1;33mCleaning up unittest...\e[0m" + @echo -e "\e[1m * Testresults from last testrun\e[0m" @ls testresults | xargs -i echo " testresults/{}" @ls testresults | xargs -i rm -f "testresults/{}" - @echo "\e[1m * Collected coverage information\e[0m" + @echo -e "\e[1m * Collected coverage information\e[0m" @$(COV3_CMD) erase +cleanall: clean + @echo -e "\e[1m * Virtualenv\e[0m" + @rm -rf venv? + release_testcases: @$(PYT3_CMD) src/unittest/scripts/unittest.py release_testcases -prepare: +prepare: venv @$(PYT3_CMD) src/unittest/scripts/unittest.py prepare testrun_full: clean prepare