Skip to content

Commit

Permalink
test some --include-* options by actually calling out to 'eb'
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Mar 18, 2016
1 parent fb371bc commit 0790849
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1914,10 +1914,8 @@ def test_include_module_naming_schemes(self):
# TestIncludedMNS module naming scheme is not available by default
args = [
'--avail-module-naming-schemes',
'--unittest-file=%s' % self.logfile,
]
self.eb_main(args, logfile=dummylogfn, raise_error=True)
logtxt = read_file(self.logfile)
logtxt, _= run_cmd("cd %s; eb %s" % (self.test_prefix, ' '.join(args)), simple=False)
self.assertFalse(mns_regex.search(logtxt), "Unexpected pattern '%s' found in: %s" % (mns_regex.pattern, logtxt))

# include extra test MNS
Expand All @@ -1934,15 +1932,10 @@ def test_include_module_naming_schemes(self):
args = [
'--avail-module-naming-schemes',
'--include-module-naming-schemes=%s/*.py' % self.test_prefix,
'--unittest-file=%s' % self.logfile,
]
self.eb_main(args, logfile=dummylogfn, raise_error=True)
logtxt = read_file(self.logfile)
logtxt, _= run_cmd("cd %s; eb %s" % (self.test_prefix, ' '.join(args)), simple=False)
self.assertTrue(mns_regex.search(logtxt), "Pattern '%s' *not* found in: %s" % (mns_regex.pattern, logtxt))

# undo successful import
del sys.modules['easybuild.tools.module_naming_scheme.test_mns']

def test_use_included_module_naming_scheme(self):
"""Test using an included module naming scheme."""
# try selecting the added module naming scheme
Expand Down Expand Up @@ -1995,10 +1988,8 @@ def test_include_toolchains(self):
# TestIncludedCompiler is not available by default
args = [
'--list-toolchains',
'--unittest-file=%s' % self.logfile,
]
self.eb_main(args, logfile=dummylogfn, raise_error=True)
logtxt = read_file(self.logfile)
logtxt, _= run_cmd("cd %s; eb %s" % (self.test_prefix, ' '.join(args)), simple=False)
self.assertFalse(tc_regex.search(logtxt), "Pattern '%s' *not* found in: %s" % (tc_regex.pattern, logtxt))

# include extra test toolchain
Expand All @@ -2020,15 +2011,9 @@ def test_include_toolchains(self):
args = [
'--include-toolchains=%s/*.py,%s/*/*.py' % (self.test_prefix, self.test_prefix),
'--list-toolchains',
'--unittest-file=%s' % self.logfile,
]
self.eb_main(args, logfile=dummylogfn, raise_error=True)
logtxt = read_file(self.logfile)
self.assertTrue(tc_regex.search(logtxt), "Pattern '%s' *not* found in: %s" % (tc_regex.pattern, logtxt))

# undo successful import
del sys.modules['easybuild.toolchains.compiler.test_comp']
del sys.modules['easybuild.toolchains.test_tc']
logtxt, _= run_cmd("cd %s; eb %s" % (self.test_prefix, ' '.join(args)), simple=False)
self.assertTrue(tc_regex.search(logtxt), "Pattern '%s' found in: %s" % (tc_regex.pattern, logtxt))

def test_cleanup_tmpdir(self):
"""Test --cleanup-tmpdir."""
Expand Down

0 comments on commit 0790849

Please sign in to comment.