public static bool IsGoogleTestExecutable()

in GoogleTestAdapter/Core/GoogleTestDiscoverer.cs [96:127]


        public static bool IsGoogleTestExecutable(string executable, string customRegex, ILogger logger)
        {
            string googleTestIndicatorFile = $"{executable}{GoogleTestIndicator}";
            if (File.Exists(googleTestIndicatorFile))
            {
                logger.DebugInfo(String.Format(Resources.FileFound, executable));
                return true;
            }

            if (string.IsNullOrWhiteSpace(customRegex))
            {
                List<string> gtestImports = new List<string>() { GoogleTestConstants.GoogleTestDllMarker, GoogleTestConstants.GoogleTestDllMarkerDebug,
                                                                 GoogleTestConstants.GoogleTestMainDllMarker, GoogleTestConstants.GoogleTestMainDllMarkerDebug };

                if (PeParser.FindImport(executable, gtestImports, StringComparison.OrdinalIgnoreCase, logger)
                    || Utils.BinaryFileContainsStrings(executable, Encoding.ASCII, GoogleTestConstants.GoogleTestExecutableMarkers))
                {
                    return true;
                }
            }
            else
            {
                if (SafeMatches(executable, customRegex, logger))
                {
                    logger.DebugInfo(String.Format(Resources.MatchesCustom, executable, customRegex));
                    return true;
                }
            }

            logger.DebugInfo(String.Format(Resources.FileNotFound, executable));
            return false;
        }