Improve example test script (with failing example)

This commit is contained in:
Alexander Engelsberger 2021-05-21 18:48:37 +02:00
parent c6992da123
commit 2aa631f4e6
3 changed files with 15 additions and 5 deletions

View File

@ -4,7 +4,9 @@ language: python
python: 3.8 python: 3.8
cache: cache:
directories: directories:
- "$HOME/.cache/pip"
- "./tests/artifacts" - "./tests/artifacts"
- "$HOME/datasets"
install: install:
- pip install git+git://github.com/si-cim/prototorch@dev --progress-bar off - pip install git+git://github.com/si-cim/prototorch@dev --progress-bar off
- pip install .[all] --progress-bar off - pip install .[all] --progress-bar off

View File

@ -4,7 +4,8 @@ import argparse
import prototorch as pt import prototorch as pt
import pytorch_lightning as pl import pytorch_lightning as pl
import torch
#import torch
if __name__ == "__main__": if __name__ == "__main__":
# Command-line arguments # Command-line arguments

View File

@ -1,10 +1,17 @@
#! /bin/bash #! /bin/bash
failed=0
for example in $(find $1 -maxdepth 1 -name "*.py") for example in $(find $1 -maxdepth 1 -name "*.py")
do do
echo "test:" $example echo -n "$x" $example '... '
export DISPLAY= && python $example --fast_dev_run 1 export DISPLAY= && python $example --fast_dev_run 1 &> /dev/null
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
exit 1 echo "Failed!!!!"
failed=1
else
echo "Success."
fi fi
done done
exit $failed