Skip to content

Commit

Permalink
AbstractScannerFunTest: Slightly modify copied files to test score im…
Browse files Browse the repository at this point in the history
…pact

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
  • Loading branch information
sschuberth committed Mar 4, 2022
1 parent a9b4c4d commit 59d0a80
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ abstract class AbstractScannerFunTest(testTags: Set<Tag> = emptySet()) : StringS

// Copy our own root license under different names to a temporary directory so we have something to operate on.
val ortLicense = File("../LICENSE")
commonlyDetectedFiles.forEach { ortLicense.copyTo(inputDir.resolve(it), overwrite = true) }
commonlyDetectedFiles.forEach {
val text = ortLicense.readText()
inputDir.resolve(it).writeText(text.replace("license", it))
}
}

init {
Expand Down
4 changes: 2 additions & 2 deletions scanner/src/funTest/kotlin/scanners/AskalonoScannerFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class AskalonoScannerFunTest : AbstractScannerFunTest() {
)

override val expectedDirectoryLicenses = listOf(
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 1.0f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 1.0f),
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 0.9891926f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 0.99112236f),
LicenseFinding("Apache-2.0", TextLocation("LICENSE", TextLocation.UNKNOWN_LINE), 1.0f)
)
}
8 changes: 4 additions & 4 deletions scanner/src/funTest/kotlin/scanners/BoyterLcScannerFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class BoyterLcScannerFunTest : AbstractScannerFunTest() {
)

override val expectedDirectoryLicenses = listOf(
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 0.98388565f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 0.98388565f),
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 0.9824694f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 0.9824694f),
LicenseFinding("Apache-2.0", TextLocation("LICENSE", TextLocation.UNKNOWN_LINE), 0.98388565f),
LicenseFinding("ECL-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 0.98301715f),
LicenseFinding("ECL-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 0.98301715f),
LicenseFinding("ECL-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 0.9814965f),
LicenseFinding("ECL-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 0.9814965f),
LicenseFinding("ECL-2.0", TextLocation("LICENSE", TextLocation.UNKNOWN_LINE), 0.98301715f)
)
}
4 changes: 2 additions & 2 deletions scanner/src/funTest/kotlin/scanners/LicenseeScannerFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class LicenseeScannerFunTest : AbstractScannerFunTest(setOf(ExpensiveTag)) {
)

override val expectedDirectoryLicenses = listOf(
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 100.0f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 100.0f),
LicenseFinding("Apache-2.0", TextLocation("COPYING", TextLocation.UNKNOWN_LINE), 99.37265f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", TextLocation.UNKNOWN_LINE), 99.49749f),
LicenseFinding("Apache-2.0", TextLocation("LICENSE", TextLocation.UNKNOWN_LINE), 100.0f)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class ScanCodeScannerFunTest : AbstractScannerFunTest(setOf(ExpensiveTag, ScanCo
)

override val expectedDirectoryLicenses = listOf(
LicenseFinding("Apache-2.0", TextLocation("COPYING", 1, 201), 99.94f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", 1, 201), 99.94f),
LicenseFinding("Apache-2.0", TextLocation("COPYING", 1, 201), 99.18f),
LicenseFinding("Apache-2.0", TextLocation("LICENCE", 1, 201), 99.18f),
LicenseFinding("Apache-2.0", TextLocation("LICENSE", 1, 201), 99.94f)
)

Expand Down

0 comments on commit 59d0a80

Please sign in to comment.