Skip to content

Instantly share code, notes, and snippets.

@asi1024
Last active September 4, 2019 08:41
Show Gist options
  • Save asi1024/952e2b84bdd727fb121e79e1e3e228b0 to your computer and use it in GitHub Desktop.
Save asi1024/952e2b84bdd727fb121e79e1e3e228b0 to your computer and use it in GitHub Desktop.
#!/bin/bash
# set -eu
# export CUDA_VISIBLE_DEVICES=-1
DIR=$1
HASH=`git rev-parse --short HEAD`
echo "DIR=${DIR}"
echo "HASH=${HASH}"
for T in `find ${DIR} | grep -E /test_.*py$`
do
echo $T | awk '{printf "%-110s",$1}'
SEC=`(/usr/bin/time -f "%U" python -m pytest -m "not slow and not gpu and not cudnn and not ideep" -k "not cuda and not gpu" ${T} > /dev/null) 2>&1`
echo $SEC | awk '{printf "%5.2f",$1}'
echo ""
done
# ./time.sh . | tee out.txt
# cat out.txt | awk '{sum+=$2} END {print sum}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment