Skip to content

Commit

Permalink
add example testing to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
izgzhen committed Oct 30, 2018
1 parent cb7fd1e commit 9d6582f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ parser.out
*.hpp
*.out
*.log
*.o

# environmental files
.venv
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dist: trusty
cache: pip
python:
- "3.5"
jdk:
- openjdk8
addons:
apt:
update: true
Expand Down Expand Up @@ -40,3 +42,4 @@ script:
--show-source
$(find cozy tests -name '*.py' -not -name 'parsetab.py')"
- python -m unittest -vb tests/*.py
- bash test_examples.sh
41 changes: 41 additions & 0 deletions test_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -x
set -e

function test_example {
cozy $1.ds --c++ $2 --simple
g++ -std=c++11 -c $2
rm $2
cozy $1.ds --java $3 --simple
javac $3
rm $3
}

cd examples

#test_example ztopo-cache ztopo-cozy.cpp TileCache.java
test_example basic basic.cpp Basic.java
test_example disjunction disjunction.cpp In.java
test_example graph graph.cpp Graph.java
test_example map map.cpp Map.java
#test_example nonscalar-tuple nonscalar-tuple.cpp Example.java
test_example read-after-write read-after-write.cpp ReadAfterWrite.java
#test_example sat4j-literal-storage sat4j-literal-storage.cpp SynthesizedLitStorage.java
test_example agg agg.cpp Aggr.java
test_example boundsbug2 boundsbug2.cpp BoundsBug2.java
#test_example docstring wordbag.cpp WordBag.java
test_example in in.cpp In.java
test_example maxbag maxbag.cpp MaxBag.java
#test_example openfire-roster roster-core.cpp RosterCore.java
#test_example redmine redmine.cpp Redmine.java # too slow now
test_example tpchq5 tpchq5.cpp TPCHQ5.java
#test_example argmin argmin.cpp MinFinder.java
test_example clausedb clausedb.cpp ClauseDB.java
test_example func func.cpp Structure.java
test_example intset intset.cpp ClauseDB.java
test_example nested-map nested-map.cpp In.java
test_example polyupdate polyupdate.cpp Polyupdate.java
#test_example rot1 rot1.cpp Rot1.java

# TODO: fix the commented out examples

0 comments on commit 9d6582f

Please sign in to comment.