Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dumpshards fix #1 #2010

Merged
merged 4 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ ios_shards.json
test_runner/src/main/resources/binaries/
ktlint
flank-scripts.jar
corellium/shard/dump/dump-shards.json
corellium/domain/test_results/*
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class DumpShardsIT {
@Category(IosTest::class)
@Test
fun `dump shards - ios`() {

val name = "$name-ios"
val result = FlankCommand(
flankPath = FLANK_JAR_PATH,
Expand All @@ -91,8 +90,7 @@ class DumpShardsIT {

shards.first().values.flatten().let { firstShard ->
assertThat(firstShard.count()).isEqualTo(8)
assertThat(firstShard)
.contains("EarlGreyExampleSwiftTests/testWithCustomFailureHandler")
assertThat(firstShard).contains("EarlGreyExampleSwiftTests/testWithCustomFailureHandler")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ gcloud:
flank:
disable-sharding: true
output-report: json
disable-usage-statistics: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

legacy-junit-result: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gcloud:
flank:
output-report: json
legacy-junit-result: true
disable-usage-statistics: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ private fun shouldDownloadBinaries(): Boolean {
}

private fun neededFilesListByOs(): List<String> = if (isWindows) {
listOf("libatomic.so.1", "libatomic.so.1.2.0", "nm.exe", "swift-demangle.exe", "swiftDemangle.dll", "xargs.cmd")
listOf(
"libatomic.so.1",
"libatomic.so.1.2.0",
"nm.exe",
"swift-demangle.exe",
"swiftDemangle.dll",
"xargs.exe",
"msys-intl-8.dll",
"msys-iconv-2.dll",
"msys-2.0.dll"
)
} else {
listOf("nm", "swift-demangle", "libatomic.so.1", "libatomic.so.1.2.0")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal fun parseObjcTests(binary: String): List<String> {
val results = mutableListOf<String>()
// https://github.com/linkedin/bluepill/blob/37e7efa42472222b81adaa0e88f2bd82aa289b44/Source/Shared/BPXCTestFile.m#L18
// must quote binary path in case there are spaces
var cmd = if (!isWindows) "nm -U ${binary.quote()}" else "llvm-nm.exe --undefined-only ${binary.quote()}"
var cmd = if (!isWindows) "nm -U ${binary.quote()}" else "llvm-nm.exe -U ${binary.quote()}"
if (!isMacOS) cmd = if (isWindows) cmd.replace("\\", "/") else "PATH=~/.flank $cmd"

val path = if (isWindows) listOf(Pair("Path", "$appDataDirectory\\.flank\\;C:\\Windows\\System32\\"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ internal fun parseSwiftTests(binary: String): List<String> {
// 'argument too long' error. xargs will split the args and run the command for each chunk.
// getconf ARG_MAX
// Windows has different limits
val argMax = if (isWindows) 251_36 else 262_144
val argMax = if (isWindows) 250_36 else 262_144

val cmd = when {
isMacOS -> "nm -gU ${binary.quote()} | xargs -s $argMax xcrun swift-demangle"
isLinux -> "export LD_LIBRARY_PATH=~/.flank; export PATH=~/.flank:\$PATH; nm -gU ${binary.quote()} | xargs -s $argMax swift-demangle"
isWindows -> "llvm-nm.exe --undefined-only --extern-only ${binary.quote().replace("\\", "/")} | xargs swift-demangle"
isWindows -> "llvm-nm.exe -gU ${binary.quote().replace("\\", "/")} | xargs.exe -s $argMax swift-demangle.exe"
else -> throw RuntimeException("Unsupported OS for Integration Tests")
}

Expand Down