From e5b57394666263be43351ca4159143b549018939 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 14 May 2021 10:28:07 +0200 Subject: [PATCH] Test for `ERROR` word when checking success of module command --- reframe/core/modules.py | 4 ++-- unittests/modules/testmod_bar | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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"