diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 49c9b2dc58df2230bbeb190132b8f47697e44bdb..75de4cb71d684c6891499520af864420fa1cb827 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -174,11 +174,11 @@ class CLanguage(object):
             if i >= 0: line = line[:i]
             if not line: continue
             if line[0] != ' ':
-              base = line
+              base = line.strip()
             else:
               assert base is not None
               assert line[1] == ' '
-              test = base + line[2:]
+              test = base + line.strip()
               cmdline = [binary] + ['--gtest_filter=%s' % test]
               out.append(self.config.job_spec(cmdline, [binary],
                                               shortname='%s:%s' % (binary, test),