diff --git a/bot/reviewbot/tools/gotool.py b/bot/reviewbot/tools/gotool.py
index 8d462fd0742923a18c5c0091329c1ab897ff486d..6154aa3a5bc6b3ac6f228f257be1ee0629e143ae 100644
--- a/bot/reviewbot/tools/gotool.py
+++ b/bot/reviewbot/tools/gotool.py
@@ -163,6 +163,7 @@
                 entry = json.loads(line)
             except ValueError:
                 found_json_errors = True
+                build_output_lines.append(line)
                 continue
 
             action = entry.get('Action')
@@ -185,9 +186,9 @@
                         test_result['output'].append(entry['Output'])
                     elif action == 'fail':
                         test_result['failed'] = True
-            elif action == 'build-output':
+            elif action in {'build-output', 'output'}:
                 build_output_lines.append(entry.get('Output', ''))
-            elif action == 'build-fail':
+            elif action in {'build-fail', 'fail'}:
                 build_failed = True
 
         if test_results:
diff --git a/bot/reviewbot/tools/tests/test_clang.py b/bot/reviewbot/tools/tests/test_clang.py
index 3329e6fe66503f347b942fb1dff56518d0364b0f..45e6e7c0edc2ee34aac6481e118cc31438cd62c2 100644
--- a/bot/reviewbot/tools/tests/test_clang.py
+++ b/bot/reviewbot/tools/tests/test_clang.py
@@ -227,8 +227,8 @@
     @integration_test()
     @simulation_test(output=(
         "test.m:3:6: error: use of undeclared identifier 'badcode'\n"
-        "    {badcode}\n"
-        "     ^\n"
+        "    3 |     {badcode}\n"
+        "      |      ^\n"
         "1 error generated.\n"
     ))
     def test_execute_with_objc_and_compiler_error(self):
@@ -256,8 +256,8 @@
                     "```\n"
                     "test.m:3:6: error: use of undeclared identifier "
                     "'badcode'\n"
-                    "    {badcode}\n"
-                    "     ^\n"
+                    "    3 |     {badcode}\n"
+                    "      |      ^\n"
                     "1 error generated.\n"
                     "```"
                 ),
@@ -386,8 +386,8 @@
     @integration_test()
     @simulation_test(output=(
         "test.mm:5:6: error: use of undeclared identifier 'badcode'\n"
-        "    {badcode}\n"
-        "     ^\n"
+        "    5 |     {badcode}\n"
+        "      |      ^\n"
         "1 error generated.\n"
     ))
     def test_execute_with_objcpp_and_compiler_error(self):
@@ -417,8 +417,8 @@
                     "```\n"
                     "test.mm:5:6: error: use of undeclared identifier "
                     "'badcode'\n"
-                    "    {badcode}\n"
-                    "     ^\n"
+                    "    5 |     {badcode}\n"
+                    "      |      ^\n"
                     "1 error generated.\n"
                     "```"
                 ),
diff --git a/bot/reviewbot/tools/tests/test_cppcheck.py b/bot/reviewbot/tools/tests/test_cppcheck.py
index 8929edc7007e3be42553f12aae4b4c0cb8ee9195..494f4521d2fd281b2000710c854f76b0cf15999c 100644
--- a/bot/reviewbot/tools/tests/test_cppcheck.py
+++ b/bot/reviewbot/tools/tests/test_cppcheck.py
@@ -178,22 +178,26 @@
                 'all_checks_enabled': True,
             })
 
-        self.assertEqual(review.comments, [
-            {
-                'filediff_id': review_file.id,
-                'first_line': 6,
-                'num_lines': 1,
-                'text': (
-                    "TemplateSimplifier: max template recursion (100) "
-                    "reached for template 'test<101>'.\n"
-                    "\n"
-                    "Column: 12\n"
-                    "Severity: information\n"
-                    "Error code: templateRecursion"
-                ),
-                'issue_opened': True,
-                'rich_text': False,
-            },
+        self.assertEqual(len(review.comments), 4)
+
+        # The templateRecursion message text varies across cppcheck
+        # versions, so check it with a regex.
+        first_comment = review.comments[0]
+        self.assertEqual(first_comment['filediff_id'], review_file.id)
+        self.assertEqual(first_comment['first_line'], 6)
+        self.assertEqual(first_comment['num_lines'], 1)
+        self.assertRegex(
+            first_comment['text'],
+            r"TemplateSimplifier: max template recursion \(100\) "
+            r"reached for template 'test<101>'\..*\n"
+            r"\n"
+            r"Column: 12\n"
+            r"Severity: information\n"
+            r"Error code: templateRecursion$")
+        self.assertTrue(first_comment['issue_opened'])
+        self.assertFalse(first_comment['rich_text'])
+
+        self.assertEqual(review.comments[1:], [
             {
                 'filediff_id': review_file.id,
                 'first_line': 4,
