summaryrefslogtreecommitdiff
path: root/dev-util/ghidra/files/ghidra-12.2-gentoo.init.gradle
blob: d99f764f20fb0f8a511b8425f2a7d6b194328a2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Gentoo dependencies.
gradle.afterProject { project ->
	if (project == project.rootProject) {
		def python = System.getenv('EPYTHON')

		if (!python) {
			throw new GradleException('EPYTHON is not set')
		}

		project.ext.PYTHON3 = [python]
	}

	if (project.path == ':Base') {
		def classpath = System.getenv('GENTOO_JAVACC_CLASSPATH')
		if (!classpath) {
			throw new GradleException('GENTOO_JAVACC_CLASSPATH is not set')
		}

		def javacc = project.configurations.getByName('javacc')

		javacc.dependencies.clear()
		project.dependencies.add(
			'javacc',
			project.files(classpath.split(File.pathSeparator))
		)
	}
}

// upstream sets ignoreFailures on every test task, so a failing suite passes

def gentooExcludedTests = [
	// expectations are metrics of Font("Times New Roman"), which only
	// media-fonts/corefonts provides
	'docking.widgets.fieldpanel.FlowLayoutTextFieldTest',
	'docking.widgets.fieldpanel.VerticalLayoutTextFieldTest',
	'docking.widgets.fieldpanel.field.CompositeVerticalLayoutTextFieldTest',
	'docking.widgets.tab.GTabPanelTest',

	// load programs from ghidra.bin, which upstream does not publish
	'ghidra.features.bsim.query.facade.SimilarFunctionQueryServiceTest',
	'ghidra.features.codecompare.decompile.DualDecompilerActionTest',
	'ghidra.feature.vt.api.BSimSelfSimilarCorrelatorTest',

	// Swing tests polled through waitForPass; not deterministic under Xvfb
	'ghidra.app.plugin.core.debug.*',
	'datagraph.graph.*',
]

gradle.taskGraph.whenReady { graph ->
	graph.allTasks.findAll { it instanceof org.gradle.api.tasks.testing.Test }.each { t ->
		t.ignoreFailures = false
		// a module emptied by an exclude reports green with nothing run
		t.filter.failOnNoMatchingTests = false
		gentooExcludedTests.each { t.filter.excludeTestsMatching it }
	}
}