Skip to content

Commit

Permalink
Tests and flake8 fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed Oct 3, 2018
1 parent 9e89ea3 commit 440ca74
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/spack/spack/build_systems/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def _std_args(pkg):
if primary_generator not in valid_generators:
msg = "Invalid CMake generator: '{0}'\n".format(generator)
msg += "CMakePackage currently supports the following "
msg += "primary generators: '{0}'".format("', '".join(valid_generators))
msg += "primary generators: '{0}'".\
format("', '".join(valid_generators))
raise InstallError(msg)

try:
Expand Down
21 changes: 21 additions & 0 deletions lib/spack/spack/test/build_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ def test_cmake_std_args(config, mock_packages):
assert get_std_cmake_args(pkg)


def test_cmake_bad_generator(config, mock_packages):
s = Spec('cmake-client')
s.concretize()
pkg = spack.repo.get(s)
pkg.generator = 'Yellow Sticky Notes'
try:
get_std_cmake_args(pkg)
except spack.package.InstallError as e:
return e
else:
pytest.fail('InstallError was not raised!')


def test_cmake_secondary_generator(config, mock_packages):
s = Spec('cmake-client')
s.concretize()
pkg = spack.repo.get(s)
pkg.generator = 'CodeBlocks - Unix Makefiles'
assert get_std_cmake_args(pkg)


@pytest.mark.usefixtures('config', 'mock_packages')
class TestAutotoolsPackage(object):

Expand Down

0 comments on commit 440ca74

Please sign in to comment.