Modularized tests. Remove obsolete PassEventReporter
^KT-56075
This commit is contained in:
committed by
Space Team
parent
8a0f3c4f1c
commit
a69bc5939f
-37
@@ -58,8 +58,6 @@ private val RUN_CHECKERS = System.getProperty("fir.bench.run.checkers", "false")
|
|||||||
private val USE_LIGHT_TREE = System.getProperty("fir.bench.use.light.tree", "true").toBooleanLenient()!!
|
private val USE_LIGHT_TREE = System.getProperty("fir.bench.use.light.tree", "true").toBooleanLenient()!!
|
||||||
private val DUMP_MEMORY = System.getProperty("fir.bench.dump.memory", "false").toBooleanLenient()!!
|
private val DUMP_MEMORY = System.getProperty("fir.bench.dump.memory", "false").toBooleanLenient()!!
|
||||||
|
|
||||||
private val REPORT_PASS_EVENTS = System.getProperty("fir.bench.report.pass.events", "false").toBooleanLenient()!!
|
|
||||||
|
|
||||||
private interface CLibrary : Library {
|
private interface CLibrary : Library {
|
||||||
fun getpid(): Int
|
fun getpid(): Int
|
||||||
fun gettid(): Int
|
fun gettid(): Int
|
||||||
@@ -88,31 +86,6 @@ internal fun isolate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PassEventReporter(private val stream: PrintStream) : AutoCloseable {
|
|
||||||
|
|
||||||
private val decimalFormat = DecimalFormat().apply {
|
|
||||||
this.maximumFractionDigits = 3
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun formatStamp(): String {
|
|
||||||
val uptime = ManagementFactoryHelper.getRuntimeMXBean().uptime
|
|
||||||
return decimalFormat.format(uptime.toDouble() / 1000)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun reportPassStart(num: Int) {
|
|
||||||
stream.println("<pass_start num='$num' stamp='${formatStamp()}'/>")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun reportPassEnd(num: Int) {
|
|
||||||
stream.println("<pass_end num='$num' stamp='${formatStamp()}'/>")
|
|
||||||
stream.flush()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun close() {
|
|
||||||
stream.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
||||||
|
|
||||||
private lateinit var dump: MultiModuleHtmlFirDump
|
private lateinit var dump: MultiModuleHtmlFirDump
|
||||||
@@ -120,8 +93,6 @@ class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
|||||||
private var bestStatistics: FirResolveBench.TotalStatistics? = null
|
private var bestStatistics: FirResolveBench.TotalStatistics? = null
|
||||||
private var bestPass: Int = 0
|
private var bestPass: Int = 0
|
||||||
|
|
||||||
private var passEventReporter: PassEventReporter? = null
|
|
||||||
|
|
||||||
private val asyncProfilerControl = AsyncProfilerControl()
|
private val asyncProfilerControl = AsyncProfilerControl()
|
||||||
|
|
||||||
@OptIn(ObsoleteTestInfrastructure::class)
|
@OptIn(ObsoleteTestInfrastructure::class)
|
||||||
@@ -230,7 +201,6 @@ class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
|||||||
override fun beforePass(pass: Int) {
|
override fun beforePass(pass: Int) {
|
||||||
if (DUMP_FIR) dump = MultiModuleHtmlFirDump(File(FIR_HTML_DUMP_PATH))
|
if (DUMP_FIR) dump = MultiModuleHtmlFirDump(File(FIR_HTML_DUMP_PATH))
|
||||||
System.gc()
|
System.gc()
|
||||||
passEventReporter?.reportPassStart(pass)
|
|
||||||
asyncProfilerControl.beforePass(pass, reportDateStr)
|
asyncProfilerControl.beforePass(pass, reportDateStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,8 +222,6 @@ class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
|||||||
if (FAIL_FAST) {
|
if (FAIL_FAST) {
|
||||||
bench.throwFailure()
|
bench.throwFailure()
|
||||||
}
|
}
|
||||||
|
|
||||||
passEventReporter?.reportPassEnd(pass)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun afterAllPasses() {
|
override fun afterAllPasses() {
|
||||||
@@ -291,11 +259,6 @@ class FirResolveModularizedTotalKotlinTest : AbstractFrontendModularizedTest() {
|
|||||||
|
|
||||||
private fun beforeAllPasses() {
|
private fun beforeAllPasses() {
|
||||||
isolate()
|
isolate()
|
||||||
|
|
||||||
if (REPORT_PASS_EVENTS) {
|
|
||||||
passEventReporter =
|
|
||||||
PassEventReporter(PrintStream(FileOutputStream(reportDir().resolve("pass-events-$reportDateStr.log"), true)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testTotalKotlin() {
|
fun testTotalKotlin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user