Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a travis.yml to run test builds #23

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: python
python:
- "3.6"

matrix:
include:
- os: linux
sudo: required
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0

install:
- ./prepare_deps.sh

script:
- python3 test_ffig_explorer.py
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pip3 install --upgrade pip && pip3 install flask

ls -al ../

git clone -b master --recurse-submodules https://github.com/FFIG/ffig.git ../ffig

touch ../ffig/__init__.py ../ffig/templates/__init__.py

ls -al ../

cd -

export PYTHONPATH="${PYTHONPATH}:/home/ffig/"
10 changes: 8 additions & 2 deletions ffig_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
import json
import shutil

import ffig.FFIG
try:
import ffig.FFIG
except ModuleNotFoundError:
import sys
sys.path.insert(0, '/home/travis/build/FFIG/ffig')
import ffig.FFIG


""" Flask app that implements a basic front-end on the home page and a rest-api under the /api/ endpoints """

Expand All @@ -30,7 +36,7 @@ def gen_bindings_from_tu():
bindings_requested = request.form["bindings_to_generate"]

# local re-write/copy of ffig functionality
ffig_subfolder = '/home/ffig/ffig/'
ffig_subfolder = '../ffig/ffig/'
template_dir = os.path.join(ffig_subfolder, 'templates')

env = ffig.FFIG.set_template_env(template_dir)
Expand Down
10 changes: 10 additions & 0 deletions prepare_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pip3 install --upgrade pip && pip3 install flask

git clone -b master --recurse-submodules https://github.com/FFIG/ffig.git ../ffig

touch ../ffig/__init__.py ../ffig/ffig/templates/__init__.py

export PYTHONPATH="${PYTHONPATH}:../ffig/"

apt-get install libclang-5.0-dev
export LD_LIBRARY_PATH=/usr/lib/llvm-5.0/lib:$LD_LIBRARY_PATH
2 changes: 2 additions & 0 deletions test_ffig_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import unittest

import sys
print(sys.path)

import ffig_explorer

Expand Down