@@ -4,7 +4,7 @@ import sys
meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines())
mem_free = meminfo['MemTotal']/1024./1024.
if mem_free < 2.:
- raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
+ print("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
sys.exit(1)
else:
print("Free memory: {:.3f} GB".format(mem_free))
@@ -1,4 +1,7 @@
#!/bin/sh
+
if ./check-memfree.py; then
- pytest -vvvv tests/ -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
+ pytest tests/ --automake
+else
+ echo "SKIP: crytography.not_enough_memory"
fi
@@ -43,6 +43,7 @@ RDEPENDS:${PN}-ptest += " \
${PYTHON_PN}-pretend \
${PYTHON_PN}-psutil \
${PYTHON_PN}-pytest \
+ ${PYTHON_PN}-unittest-automake-output \
${PYTHON_PN}-pytest-subtests \
${PYTHON_PN}-pytz \
"
Instead of using sed to reformat the output use this new module. Also show a skip message instead of nothing if the tests were skipped due to a lack of memory. Signed-off-by: Ross Burton <ross.burton@arm.com> --- .../python/python3-cryptography/check-memfree.py | 2 +- meta/recipes-devtools/python/python3-cryptography/run-ptest | 5 ++++- meta/recipes-devtools/python/python3-cryptography_39.0.2.bb | 1 + 3 files changed, 6 insertions(+), 2 deletions(-)