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

@ -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'))