Skip to content

Commit

Permalink
Merge pull request #18190 Unignore or remove @ignored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-gradle committed Sep 4, 2021
2 parents 1f63de5 + 769af53 commit 758c7ad
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import org.gradle.nativeplatform.fixtures.RequiresInstalledToolChain
import org.gradle.nativeplatform.fixtures.ToolChainRequirement
import org.gradle.nativeplatform.fixtures.app.IncrementalHelloWorldApp
import org.gradle.test.fixtures.file.TestFile
import org.gradle.util.internal.GUtil
import org.gradle.util.Requires
import org.gradle.util.TestPrecondition
import org.gradle.util.internal.GUtil
import org.junit.Assume
import spock.lang.Ignore
import spock.lang.IgnoreIf
import spock.lang.Issue

Expand Down Expand Up @@ -597,54 +596,6 @@ abstract class AbstractNativeLanguageIncrementalBuildIntegrationTest extends Abs
fails mainCompileTask
}

@Ignore("Test demonstrates missing functionality in incremental build with C++")
def "recompiles binary when header file with relative path changes"() {
when:
buildFile << """
plugins {
id 'cpp'
}
model {
components {
main(NativeExecutableSpec)
}
}
"""

file("src/main/cpp/main.cpp") << """
#include "../not_included/hello.h"
int main () {
sayHello();
return 0;
}
"""

def headerFile = file("src/main/not_included/hello.h") << """
void sayHello();
"""

file("src/main/cpp/hello.cpp") << """
#include <iostream>
void sayHello() {
std::cout << "HELLO" << std::endl;
}
"""
then:
succeeds "mainExecutable"
executable("build/exe/main/main").exec().out == "HELLO\n"

when:
headerFile.text = """
NOT A VALID HEADER FILE
"""
then:
fails "mainExecutable"
and:
executedAndNotSkipped "compileMainExecutableMainCpp"
}

def buildingCorCppWithGcc() {
return toolChain.meets(ToolChainRequirement.GCC) && (sourceType == "C" || sourceType == "Cpp")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

package org.gradle.language

import org.apache.commons.lang.RandomStringUtils

import org.gradle.integtests.fixtures.ToBeFixedForConfigurationCache
import org.gradle.nativeplatform.fixtures.AbstractInstalledToolChainIntegrationSpec
import org.gradle.nativeplatform.fixtures.app.HelloWorldApp
import org.gradle.test.fixtures.file.TestFile
import org.gradle.util.Requires
import org.gradle.util.TestPrecondition
import spock.lang.Ignore

abstract class AbstractNativeLanguageIntegrationTest extends AbstractInstalledToolChainIntegrationSpec {

Expand Down Expand Up @@ -282,36 +280,5 @@ abstract class AbstractNativeLanguageIntegrationTest extends AbstractInstalledTo
def secondOptionsOrder = secondOptions.linkedObjects().collect { it.name }
firstOptionsOrder == secondOptionsOrder
}

@Ignore
def "can run project in extended nested file paths"() {
// windows can't handle a path up to 260 characters
// we create a path that ends up with build folder longer than is 260
def projectPathOffset = 180 - testDirectory.getAbsolutePath().length()
def nestedProjectPath = RandomStringUtils.randomAlphanumeric(projectPathOffset - 10) + "/123456789"

setup:
def deepNestedProjectFolder = file(nestedProjectPath)
executer.usingProjectDirectory(deepNestedProjectFolder)
def TestFile buildFile = deepNestedProjectFolder.file("build.gradle")
buildFile << helloWorldApp.pluginScript
buildFile << helloWorldApp.extraConfiguration
buildFile << """
model {
components {
main(NativeExecutableSpec)
}
}
"""

and:
helloWorldApp.writeSources(file("$nestedProjectPath/src/main"))

expect:
succeeds "mainExecutable"
def mainExecutable = executable("$nestedProjectPath/build/exe/main/main")
mainExecutable.assertExists()
mainExecutable.exec().out == helloWorldApp.englishOutput
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

package org.gradle.language.objectivec

import org.gradle.internal.hash.Hashing

import org.gradle.language.AbstractNativeLanguageIncrementalBuildIntegrationTest
import org.gradle.nativeplatform.fixtures.RequiresInstalledToolChain
import org.gradle.nativeplatform.fixtures.app.IncrementalHelloWorldApp
import org.gradle.nativeplatform.fixtures.app.ObjectiveCHelloWorldApp
import org.gradle.util.Requires
import org.gradle.util.TestPrecondition
import spock.lang.Ignore

import static org.gradle.nativeplatform.fixtures.ToolChainRequirement.GCC_COMPATIBLE

Expand All @@ -36,27 +35,6 @@ class ObjectiveCLanguageIncrementalBuildIntegrationTest extends AbstractNativeLa
return false
}

@Ignore("Demos a problem with clang on ubuntu creating randomly different object files")
def "generates always exactly same object file"() {
setup:
def recordings = []
def invocation = 10
when:
invocation.times{
run "cleanCompileHelloSharedLibraryHello$sourceType", "compileHelloSharedLibraryHello$sourceType"
def oldHash = Hashing.sha1().hashFile(objectFileFor(librarySourceFiles[0], "build/objs/helloSharedLibrary/hello$sourceType")).toCompactString()

//to ensure it's not a timestamp issue
sleep(1000)
run "cleanCompileHelloSharedLibraryHello$sourceType", "compileHelloSharedLibraryHello$sourceType"
def newHash = Hashing.sha1().hashFile(objectFileFor(librarySourceFiles[0], "build/objs/helloSharedLibrary/hello$sourceType")).toCompactString()
recordings << (oldHash == newHash)
}
then:
recordings.findAll{ it }.size() != 0 // not everytime the .o file differs -> not a timestamp issue
recordings.findAll{ it }.size() == invocation
}

@Override
IncrementalHelloWorldApp getHelloWorldApp() {
return new ObjectiveCHelloWorldApp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.gradle.language.rc

import net.rubygrapefruit.platform.WindowsRegistry
import org.apache.commons.lang.RandomStringUtils
import org.gradle.internal.os.OperatingSystem
import org.gradle.language.AbstractNativeLanguageIntegrationTest
import org.gradle.nativeplatform.fixtures.RequiresInstalledToolChain
Expand All @@ -25,10 +24,8 @@ import org.gradle.nativeplatform.fixtures.app.WindowsResourceHelloWorldApp
import org.gradle.nativeplatform.toolchain.internal.msvcpp.DefaultWindowsSdkLocator
import org.gradle.nativeplatform.toolchain.internal.msvcpp.WindowsSdkInstall
import org.gradle.nativeplatform.toolchain.internal.msvcpp.WindowsSdkLocator
import org.gradle.test.fixtures.file.TestFile
import org.gradle.testfixtures.internal.NativeServicesTestFixture
import org.gradle.util.internal.TextUtil
import spock.lang.Ignore
import spock.lang.Unroll

import static org.gradle.nativeplatform.fixtures.ToolChainRequirement.VISUALCPP
Expand All @@ -40,16 +37,6 @@ class WindowsResourcesIntegrationTest extends AbstractNativeLanguageIntegrationT
HelloWorldApp helloWorldApp = new WindowsResourceHelloWorldApp()

@Unroll
@Ignore("""
We got failures saying:
hello.cpp
C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um\\winnt.h(5239): error C2169: '_InterlockedAdd': intrinsic function, cannot be defined
C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um\\winnt.h(5423): error C2169: '_InterlockedAnd64': intrinsic function, cannot be defined
...
Which seems to come from newer version of VS 2019. Ignore this test for now.
""")
def "compile and link executable with #sdk.name (#sdk.version.toString()) [#tc.displayName]"() {
given:
buildFile << """
Expand Down Expand Up @@ -171,37 +158,6 @@ model {
installation("build/install/main").exec().out == "Hello!"
}

@Ignore
def "windows resources compiler can use long file paths"() {
// windows can't handle a path up to 260 characters
// we create a project path that is ~180 characters to end up
// with a path for the compiled resources.res > 260 chars
def projectPathOffset = 180 - testDirectory.getAbsolutePath().length()
def nestedProjectPath = RandomStringUtils.randomAlphanumeric(projectPathOffset - 10) + "/123456789"

setup:
def deepNestedProjectFolder = file(nestedProjectPath)
executer.usingProjectDirectory(deepNestedProjectFolder)
def TestFile buildFile = deepNestedProjectFolder.file("build.gradle")
buildFile << helloWorldApp.pluginScript
buildFile << helloWorldApp.extraConfiguration
buildFile << """
model {
components {
main(NativeExecutableSpec)
}
}
"""

and:
helloWorldApp.writeSources(file("$nestedProjectPath/src/main"))

expect:
// this test is just for verifying explicitly the behaviour of the windows resource compiler
// that's why we explicitly trigger this task instead of main.
succeeds "mainExecutable"
}

static List<WindowsSdkInstall> getNonDefaultSdks() {
WindowsSdkLocator locator = new DefaultWindowsSdkLocator(OperatingSystem.current(), NativeServicesTestFixture.getInstance().get(WindowsRegistry.class))
WindowsSdkInstall defaultSdk = locator.locateComponent(null).component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ import org.gradle.nativeplatform.fixtures.app.SwiftApp
import org.gradle.nativeplatform.fixtures.app.SwiftLib
import org.gradle.test.fixtures.file.TestFile
import org.gradle.util.internal.VersionNumber
import spock.lang.Ignore

@RequiresInstalledToolChain(ToolChainRequirement.SWIFTC)
@Ignore("https://github.com/gradle/gradle-private/issues/3387")
class SwiftIncrementalBuildIntegrationTest extends AbstractInstalledToolChainIntegrationSpec {
@ToBeFixedForConfigurationCache
def "rebuilds application when a single source file changes"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package org.gradle.launcher.continuous
import org.gradle.integtests.fixtures.AbstractContinuousIntegrationTest
import org.gradle.util.Requires
import org.gradle.util.TestPrecondition
import spock.lang.Ignore

class CancellationContinuousIntegrationTest extends AbstractContinuousIntegrationTest {

Expand Down Expand Up @@ -64,7 +63,6 @@ class CancellationContinuousIntegrationTest extends AbstractContinuousIntegratio
cancelsAndExits()
}

@Ignore("TODO: Fix GradleHandle.abort() so that it doesn't hang")
@Requires(TestPrecondition.NOT_WINDOWS)
// GradleHandle.abort() is unsafe on Windows - this is a test infrastructure problem
def "does not cancel on EOT or by closing System.in when not interactive"() {
Expand Down

0 comments on commit 758c7ad

Please sign in to comment.