internal static bool RunAssetStoreValidationSuite(string packageName, string packageVersion, string packagePath, string previousPackagePath = null)
        {
            if (string.IsNullOrEmpty(packageName))
            {
                throw new ArgumentNullException(packageName);
            }

            if (string.IsNullOrEmpty(packageVersion))
            {
                throw new ArgumentNullException(packageVersion);
            }

            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentNullException(packageName);
            }

            var report = new ValidationSuiteReport(packageName + "@" + packageVersion, packageName, packageVersion, packagePath);

            try
            {
                var context   = VettingContext.CreateAssetStoreContext(packageName, packageVersion, packagePath, previousPackagePath);
                var testSuite = new ValidationSuite(SingleTestCompletedDelegate, AllTestsCompletedDelegate, context, report);
                testSuite.RunSync();
                return(testSuite.testSuiteState == TestState.Succeeded);
            }
            catch (Exception e)
            {
                report.OutputErrorReport(string.Format("\r\nTest Setup Error: \"{0}\"\r\n", e));
                return(false);
            }
        }
        public static bool ValidatePackage(VettingContext context, out ValidationSuiteReport report)
        {
            Profiler.BeginSample("ValidatePackage");

            report = new ValidationSuiteReport(context.ProjectPackageInfo.Id, context.ProjectPackageInfo.name, context.ProjectPackageInfo.version, context.ProjectPackageInfo.path);

            try
            {
                // publish locally for embedded and local packages
                var testSuite = new ValidationSuite(SingleTestCompletedDelegate, AllTestsCompletedDelegate, context, report);

                report.Initialize(testSuite.context);
                testSuite.RunSync();
                Profiler.EndSample();
                return(testSuite.testSuiteState == TestState.Succeeded);
            }
            catch (Exception e)
            {
                report.OutputErrorReport(string.Format("Test Setup Error: \"{0}\"\r\n", e));
                Profiler.EndSample();
                return(false);
            }
        }