test only using local files; fixes #21
This commit is contained in:
12
test/test.py
12
test/test.py
@ -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'))
|
||||
|
Reference in New Issue
Block a user