From aa6aec7d8659b6151505d674e9c9cc9816d8e29f Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Wed, 7 May 2014 05:49:43 +0200 Subject: [PATCH] Add a test script and a YML file for travis-CI --- .gitignore | 1 + .travis.yml | 6 ++++++ test.sh | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 .travis.yml create mode 100644 test.sh diff --git a/.gitignore b/.gitignore index 45e9481..27ce633 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /README.txt *.pyc *.pyo +/examples/expr.py diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..09bef98 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: python +python: + - "2.7" + - "3.3" + - "3.4" +script: sh test.sh diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..4a9f6e4 --- /dev/null +++ b/test.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e +trap 'echo ERROR' 0 + +export PYTHONPATH=$(pwd) +for PY_G in python python3 ; do +$PY_G ./yapps2 examples/expr.g examples/expr.py + +for PY_X in python python3 ; do +test "$(echo "1+2*3+4" | $PY_X examples/expr.py goal)" = 11 +done + +done + +trap 'rm examples/expr.py; echo OK' 0