Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6750f761 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Add the API stats file to the golden test

- Also clean up diff-and-update-golden.sh and the test python script.
  (removed -2 and -3 options, which I haven't used for a while)
- Random small fixes to HSG

Bug: 418286901
Test: atest tiny-framework-dump-test
    with and without intentional change to the new golden file
Test: ./diff-and-update-golden.sh
    with and without intentional change to the new golden file
Test: Run ravenwood-stats-collector.sh and make sure the generated
    CVS file doesn't change.
Flag: TEST_ONLY

Change-Id: Ice112cfc7f67b58abc43538ca81785569ed8efc9
parent 14788606
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

python_binary_host {
    name: "csv-flattener",
    srcs: ["csv-flattener.py"],

    visibility: ["//visibility:public"],
}
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ flatten() {

    echo "Flattening $csv to $to ..."
    # "grep -v" to remove timestamps.
    "$SCRIPT_DIR"/csv-flattener "$csv" | grep -v "^  20[0-9][0-9]-[0-9][0-9]" > "$to"
    "$SCRIPT_DIR"/csv-flattener.py "$csv" | grep -v "^  20[0-9][0-9]-[0-9][0-9]" > "$to"
}

do_diff() {
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,11 @@ fun normalizeTextLine(s: String): String {
    return uncommented.trim()
}

// Note, Soong clears unknown env vars, so $HSG_ALWAYS_SHOW_STACKTRACE doesn't work
// if the command is executed on soong. In that case, you need to change this flag directly.
val ALWAYS_SHOW_STACKTRACE: Boolean = false ||
    "1".equals(System.getenv("HSG_ALWAYS_SHOW_STACKTRACE"))

/**
 * Concatenate list [a] and [b] and return it. As an optimization, it returns an input
 * [List] as-is if the other [List] is empty, so do not modify input [List]'s.
@@ -109,7 +114,7 @@ inline fun runMainWithBoilerplate(realMain: () -> Unit) {
        success = true
    } catch (e: Throwable) {
        log.e("$executableName: Error: ${e.message}")
        if (e !is UserErrorException) {
        if (e !is UserErrorException || ALWAYS_SHOW_STACKTRACE) {
            e.printStackTrace(PrintWriter(log.getWriter(LogLevel.Error)))
        }
    } finally {
+4 −0
Original line number Diff line number Diff line
@@ -228,6 +228,10 @@ class FileOrResource(val path: String) {
            FileReader(path)
        }
    }

    override fun toString(): String {
        return path
    }
}

fun String.ensureFileExists(): String {
Loading