Beispiel #1
0
        private bool VersionMatches(TestDescriptor test, Version runtimeVersion)
        {
            if (test.VersionSpecific)
            {
                if ((runtimeVersion.Major + ".x").Equals(test.Version, StringComparison.Ordinal))
                {
                    return(true);
                }
                else if (runtimeVersion.MajorMinor.Equals(test.Version, StringComparison.Ordinal))
                {
                    return(true);
                }

                return(false);
            }
            else
            {
                var testVersion = Version.Parse(test.Version);
                if (runtimeVersion >= testVersion)
                {
                    return(true);
                }

                return(false);
            }
        }
Beispiel #2
0
        public bool ShouldRunTest(SystemUnderTest system, TestDescriptor test)
        {
            if (!test.Enabled)
            {
                return(false);
            }

            if (!VersionMatches(test, system.RuntimeVersion))
            {
                return(false);
            }

            if (system.SdkVersion == null && test.RequiresSdk)
            {
                return(false);
            }

            var skipped = system.CurrentPlatformIds
                          .Where(rid => test.IgnoredRIDs.Contains(rid))
                          .Any();

            if (skipped)
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        public bool ShouldRunTest(SystemUnderTest system, TestDescriptor test)
        {
            if (!test.Enabled)
            {
                return(false);
            }

            if (!VersionMatches(test, system.RuntimeVersion))
            {
                return(false);
            }

            var blacklisted = system.CurrentPlatformIds
                              .Where(rid => test.PlatformBlacklist.Contains(rid))
                              .Any();

            if (blacklisted)
            {
                return(false);
            }

            return(true);
        }
Beispiel #4
0
 public XUnitTest(DirectoryInfo directory, SystemUnderTest system, string nuGetConfig, TestDescriptor descriptor, bool enabled)
     : base(directory, system, nuGetConfig, descriptor, enabled)
 {
 }
Beispiel #5
0
 public Test(DirectoryInfo testDirectory, SystemUnderTest system, string nuGetConfig, TestDescriptor descriptor, bool enabled)
 {
     this.Directory       = testDirectory;
     this.SystemUnderTest = system;
     this.NuGetConfig     = nuGetConfig;
     this.Descriptor      = descriptor;
     this.Skip            = !enabled;
 }
Beispiel #6
0
 public BashTest(DirectoryInfo directory, SystemUnderTest system, string nuGetConfig, TestDescriptor test, bool enabled)
     : base(directory, system, nuGetConfig, test, enabled)
 {
 }