Add prefix to cctests when listed to make retrieving them more robust

Bug: v8:12802
Change-Id: I4e12edc71ce110f603026f2b9a446af8965f9510
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3598887
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80208}
This commit is contained in:
Al Muthanna Athamina 2022-04-27 10:38:35 +02:00 committed by V8 LUCI CQ
parent 353e95daa2
commit 6df1aef278
2 changed files with 18 additions and 5 deletions

View File

@ -336,9 +336,12 @@ i::Handle<i::JSFunction> Optimize(
}
static void PrintTestList() {
int test_num = 0;
for (const auto& entry : g_cctests.Get()) {
printf("%s\n", entry.first.c_str());
printf("**>Test: %s\n", entry.first.c_str());
test_num++;
}
printf("\nTotal number of tests: %d\n", test_num);
}
int main(int argc, char* argv[]) {

View File

@ -56,10 +56,20 @@ class TestLoader(testsuite.TestLoader):
print(output.stderr)
return []
filtered_output = [
test for test in output.stdout.strip().split()
if test.startswith('test-')
]
filtered_output = []
test_prefix = '**>Test: '
test_total_prefix = 'Total number of tests: '
tests_total = 0
for line in output.stdout.strip().splitlines():
if line.startswith(test_prefix):
filtered_output.append(line[len(test_prefix):])
if line.startswith(test_total_prefix):
tests_total = int(line[len(test_total_prefix):])
assert (len(filtered_output) > 0)
assert (len(filtered_output) == tests_total)
return sorted(filtered_output)