diff --git a/src/test.cc b/src/test.cc
index 4041135e..7592d701 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -121,7 +121,7 @@ bool RunIndexTests(const std::string& filter_path, bool enable_update) {
     std::cerr << "Index tests must be run using clang version \""
               << kRequiredClangVersion << "\" (cquery is running with \""
               << GetClangVersion() << "\")" << std::endl;
-    exit(1);
+    return false;
   }
 
   bool success = true;