test only using local files; fixes #21

This commit is contained in:
Radovan Bast 2015-06-28 11:12:36 +02:00
parent d7061493fc
commit 3d02918ffe
4 changed files with 15 additions and 14 deletions

View File

@ -2,8 +2,6 @@ language: cpp
install:
- sudo apt-get install g++ cmake gfortran
- sudo pip install pytest pep8
before_script:
- export PYTHONPATH=$PYTHONPATH:$(pwd)
script:
- pep8 --ignore=E501 update.py
- pep8 --ignore=E501 test/test.py

View File

@ -2,14 +2,14 @@
name: example
[cxx]
source: https://github.com/scisoft/autocmake/raw/master/modules/cxx.cmake
source: ../../../modules/cxx.cmake
docopt: --cxx=<CXX> C++ compiler [default: g++].
--extra-cxx-flags=<EXTRA_CXXFLAGS> Extra C++ compiler flags [default: ''].
export: 'CXX=%s' % arguments['--cxx']
define: '-DEXTRA_CXXFLAGS="%s"' % arguments['--extra-cxx-flags']
[default_build_paths]
source: https://github.com/scisoft/autocmake/raw/master/modules/default_build_paths.cmake
source: ../../../modules/default_build_paths.cmake
[src]
source: https://github.com/scisoft/autocmake/raw/master/modules/src.cmake
source: ../../../modules/src.cmake

View File

@ -2,17 +2,14 @@
name: example
[fc]
source: https://github.com/scisoft/autocmake/raw/master/modules/fc.cmake
source: ../../../modules/fc.cmake
docopt: --fc=<FC> Fortran compiler [default: gfortran].
--extra-fc-flags=<EXTRA_FCFLAGS> Extra Fortran compiler flags [default: ''].
export: 'FC=%s' % arguments['--fc']
define: '-DEXTRA_FCFLAGS="%s"' % arguments['--extra-fc-flags']
[compilers]
source: https://github.com/scisoft/autocmake/raw/master/compilers/GNU.Fortran.cmake
[default_build_paths]
source: https://github.com/scisoft/autocmake/raw/master/modules/default_build_paths.cmake
source: ../../../modules/default_build_paths.cmake
[src]
source: https://github.com/scisoft/autocmake/raw/master/modules/src.cmake
source: ../../../modules/src.cmake

View File

@ -1,9 +1,11 @@
import os
import subprocess
import update
import shutil
HERE = os.path.abspath(os.path.dirname(__file__))
# ------------------------------------------------------------------------------
def exe(command):
stdout, stderr = subprocess.Popen(command.split(),
@ -11,10 +13,12 @@ def exe(command):
stderr=subprocess.PIPE).communicate()
return stdout, stderr
# ------------------------------------------------------------------------------
def test_cxx():
os.chdir(os.path.join(HERE, 'cxx', 'cmake'))
update.fetch_url('https://github.com/scisoft/autocmake/raw/master/update.py', 'update.py')
shutil.copy(os.path.join('..', '..', '..', 'update.py'), 'update.py')
stdout, stderr = exe('python update.py --self')
stdout, stderr = exe('python update.py ..')
os.chdir(os.path.join(HERE, 'cxx'))
@ -24,10 +28,12 @@ def test_cxx():
stdout, stderr = exe('./bin/example')
assert 'Hello World!' in stdout
# ------------------------------------------------------------------------------
def test_fc():
os.chdir(os.path.join(HERE, 'fc', 'cmake'))
update.fetch_url('https://github.com/scisoft/autocmake/raw/master/update.py', 'update.py')
shutil.copy(os.path.join('..', '..', '..', 'update.py'), 'update.py')
stdout, stderr = exe('python update.py --self')
stdout, stderr = exe('python update.py ..')
os.chdir(os.path.join(HERE, 'fc'))