test only using local files; fixes #21
This commit is contained in:
parent
d7061493fc
commit
3d02918ffe
@ -2,8 +2,6 @@ language: cpp
|
|||||||
install:
|
install:
|
||||||
- sudo apt-get install g++ cmake gfortran
|
- sudo apt-get install g++ cmake gfortran
|
||||||
- sudo pip install pytest pep8
|
- sudo pip install pytest pep8
|
||||||
before_script:
|
|
||||||
- export PYTHONPATH=$PYTHONPATH:$(pwd)
|
|
||||||
script:
|
script:
|
||||||
- pep8 --ignore=E501 update.py
|
- pep8 --ignore=E501 update.py
|
||||||
- pep8 --ignore=E501 test/test.py
|
- pep8 --ignore=E501 test/test.py
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
name: example
|
name: example
|
||||||
|
|
||||||
[cxx]
|
[cxx]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/cxx.cmake
|
source: ../../../modules/cxx.cmake
|
||||||
docopt: --cxx=<CXX> C++ compiler [default: g++].
|
docopt: --cxx=<CXX> C++ compiler [default: g++].
|
||||||
--extra-cxx-flags=<EXTRA_CXXFLAGS> Extra C++ compiler flags [default: ''].
|
--extra-cxx-flags=<EXTRA_CXXFLAGS> Extra C++ compiler flags [default: ''].
|
||||||
export: 'CXX=%s' % arguments['--cxx']
|
export: 'CXX=%s' % arguments['--cxx']
|
||||||
define: '-DEXTRA_CXXFLAGS="%s"' % arguments['--extra-cxx-flags']
|
define: '-DEXTRA_CXXFLAGS="%s"' % arguments['--extra-cxx-flags']
|
||||||
|
|
||||||
[default_build_paths]
|
[default_build_paths]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/default_build_paths.cmake
|
source: ../../../modules/default_build_paths.cmake
|
||||||
|
|
||||||
[src]
|
[src]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/src.cmake
|
source: ../../../modules/src.cmake
|
||||||
|
@ -2,17 +2,14 @@
|
|||||||
name: example
|
name: example
|
||||||
|
|
||||||
[fc]
|
[fc]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/fc.cmake
|
source: ../../../modules/fc.cmake
|
||||||
docopt: --fc=<FC> Fortran compiler [default: gfortran].
|
docopt: --fc=<FC> Fortran compiler [default: gfortran].
|
||||||
--extra-fc-flags=<EXTRA_FCFLAGS> Extra Fortran compiler flags [default: ''].
|
--extra-fc-flags=<EXTRA_FCFLAGS> Extra Fortran compiler flags [default: ''].
|
||||||
export: 'FC=%s' % arguments['--fc']
|
export: 'FC=%s' % arguments['--fc']
|
||||||
define: '-DEXTRA_FCFLAGS="%s"' % arguments['--extra-fc-flags']
|
define: '-DEXTRA_FCFLAGS="%s"' % arguments['--extra-fc-flags']
|
||||||
|
|
||||||
[compilers]
|
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/compilers/GNU.Fortran.cmake
|
|
||||||
|
|
||||||
[default_build_paths]
|
[default_build_paths]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/default_build_paths.cmake
|
source: ../../../modules/default_build_paths.cmake
|
||||||
|
|
||||||
[src]
|
[src]
|
||||||
source: https://github.com/scisoft/autocmake/raw/master/modules/src.cmake
|
source: ../../../modules/src.cmake
|
||||||
|
12
test/test.py
12
test/test.py
@ -1,9 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import update
|
import shutil
|
||||||
|
|
||||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def exe(command):
|
def exe(command):
|
||||||
stdout, stderr = subprocess.Popen(command.split(),
|
stdout, stderr = subprocess.Popen(command.split(),
|
||||||
@ -11,10 +13,12 @@ def exe(command):
|
|||||||
stderr=subprocess.PIPE).communicate()
|
stderr=subprocess.PIPE).communicate()
|
||||||
return stdout, stderr
|
return stdout, stderr
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def test_cxx():
|
def test_cxx():
|
||||||
os.chdir(os.path.join(HERE, 'cxx', 'cmake'))
|
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 --self')
|
||||||
stdout, stderr = exe('python update.py ..')
|
stdout, stderr = exe('python update.py ..')
|
||||||
os.chdir(os.path.join(HERE, 'cxx'))
|
os.chdir(os.path.join(HERE, 'cxx'))
|
||||||
@ -24,10 +28,12 @@ def test_cxx():
|
|||||||
stdout, stderr = exe('./bin/example')
|
stdout, stderr = exe('./bin/example')
|
||||||
assert 'Hello World!' in stdout
|
assert 'Hello World!' in stdout
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def test_fc():
|
def test_fc():
|
||||||
os.chdir(os.path.join(HERE, 'fc', 'cmake'))
|
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 --self')
|
||||||
stdout, stderr = exe('python update.py ..')
|
stdout, stderr = exe('python update.py ..')
|
||||||
os.chdir(os.path.join(HERE, 'fc'))
|
os.chdir(os.path.join(HERE, 'fc'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user