This commit is contained in:
Radovan Bast 2015-08-07 17:23:11 +02:00
parent 423eb8bcf2
commit 1cee0e6798

View File

@ -90,8 +90,15 @@ def configure_build_and_exe(name, setup_command, launcher=None):
stdout, stderr = exe('python update.py ..') stdout, stderr = exe('python update.py ..')
os.chdir(os.path.join(HERE, name)) os.chdir(os.path.join(HERE, name))
make_command = 'make'
binary = './bin/example'
if sys.platform == 'win32': if sys.platform == 'win32':
setup_command += ' --generator="MinGW Makefiles"' setup_command += ' --generator="MinGW Makefiles"'
make_command = 'mingw32-make'
binary = 'bin\\\example.exe'
if launcher:
binary = '%s %s' % (launcher, binary)
setup_command += ' build-%s' % stamp setup_command += ' build-%s' % stamp
@ -99,83 +106,65 @@ def configure_build_and_exe(name, setup_command, launcher=None):
os.chdir(os.path.join(HERE, name, 'build-%s' % stamp)) os.chdir(os.path.join(HERE, name, 'build-%s' % stamp))
if sys.platform == 'win32': stdout, stderr = exe(make_command)
stdout, stderr = exe('mingw32-make')
if (launcher):
stdout, stderr = exe(launcher + ' bin\\\example.exe')
else:
stdout, stderr = exe('bin\\\example.exe')
else:
stdout, stderr = exe('make')
if (launcher):
stdout, stderr = exe(launcher + ' ./bin/example')
else:
stdout, stderr = exe('./bin/example')
return stdout, stderr stdout, stderr = exe(binary)
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_cxx_custom(): def test_cxx_custom():
stdout, stderr = configure_build_and_exe('cxx_custom', 'python setup.py --cxx=g++') configure_build_and_exe('cxx_custom', 'python setup.py --cxx=g++')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_extra_cmake_options(): def test_extra_cmake_options():
stdout, stderr = configure_build_and_exe('extra_cmake_options', 'python setup.py --cxx=g++ --cmake-options="-DENABLE_SOMETHING=OFF -DENABLE_FOO=ON"') configure_build_and_exe('extra_cmake_options', 'python setup.py --cxx=g++ --cmake-options="-DENABLE_SOMETHING=OFF -DENABLE_FOO=ON"')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_cxx(): def test_cxx():
stdout, stderr = configure_build_and_exe('cxx', 'python setup.py --cxx=g++') configure_build_and_exe('cxx', 'python setup.py --cxx=g++')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_fc(): def test_fc():
stdout, stderr = configure_build_and_exe('fc', 'python setup.py --fc=gfortran') configure_build_and_exe('fc', 'python setup.py --fc=gfortran')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_fc_git_info(): def test_fc_git_info():
stdout, stderr = configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran') configure_build_and_exe('fc_git_info', 'python setup.py --fc=gfortran')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def test_fc_int64(): def test_fc_int64():
stdout, stderr = configure_build_and_exe('fc_int64', 'python setup.py --fc=gfortran --int64') configure_build_and_exe('fc_int64', 'python setup.py --fc=gfortran --int64')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@no_windows @no_windows
def test_fc_mpi(): def test_fc_mpi():
stdout, stderr = configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90', 'mpirun -np 2') configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90', 'mpirun -np 2')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@no_windows @no_windows
def test_fc_blas(): def test_fc_blas():
stdout, stderr = configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran') configure_build_and_exe('fc_blas', 'python setup.py --fc=gfortran')
assert 'PASSED' in stdout
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@no_windows @no_windows
def test_fc_lapack(): def test_fc_lapack():
stdout, stderr = configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran') configure_build_and_exe('fc_lapack', 'python setup.py --fc=gfortran')
assert 'PASSED' in stdout