diff --git a/reframe/core/modules.py b/reframe/core/modules.py index e4cc552310..aa86ca423a 100644 --- a/reframe/core/modules.py +++ b/reframe/core/modules.py @@ -637,7 +637,7 @@ def modulecmd(self, *args): def _execute(self, cmd, *args): modulecmd = self.modulecmd(cmd, *args) completed = osext.run_command(modulecmd) - if re.search(r'ERROR', completed.stderr) is not None: + if re.search(r'\bERROR\b', completed.stderr) is not None: raise SpawnedProcessError(modulecmd, completed.stdout, completed.stderr, @@ -769,7 +769,7 @@ def modulecmd(self, *args): def _execute(self, cmd, *args): modulecmd = self.modulecmd(cmd, *args) completed = osext.run_command(modulecmd) - if re.search(r'ERROR', completed.stderr) is not None: + if re.search(r'\bERROR\b', completed.stderr) is not None: raise SpawnedProcessError(modulecmd, completed.stdout, completed.stderr, diff --git a/unittests/modules/testmod_bar b/unittests/modules/testmod_bar index 8fa8337d64..a710ba6c43 100644 --- a/unittests/modules/testmod_bar +++ b/unittests/modules/testmod_bar @@ -10,3 +10,4 @@ conflict testmod_foo conflict testmod_boo setenv TESTMOD_BAR "BAR" +setenv TESTMOD_ERROR "BARERROR"