Skip to content

Commit

Permalink
Fixed most Test262 results
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Oct 27, 2023
1 parent d7e099b commit 3a27e1d
Show file tree
Hide file tree
Showing 25 changed files with 80 additions and 36 deletions.
68 changes: 56 additions & 12 deletions test262/fix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import json, os
import json
import os


def suite_conformance(suite):
global function_suite
Expand Down Expand Up @@ -46,6 +48,7 @@ def suite_conformance(suite):

return res


def version_conformance(suite):
res = {}

Expand Down Expand Up @@ -76,11 +79,11 @@ def version_conformance(suite):
key = str(version)
if key not in res.keys():
res[key] = {
"t": 0,
"o": 0,
"i": 0,
"p": 0
}
"t": 0,
"o": 0,
"i": 0,
"p": 0
}

res[key]["t"] += 1
if "s" in test.keys() and "r" in test.keys():
Expand All @@ -107,6 +110,7 @@ def version_conformance(suite):

return res


def fix_tests(tests):
fixed = {}

Expand All @@ -133,6 +137,7 @@ def fix_tests(tests):

return fixed


def fix_suite(suites):
fixed = {}
for suite in suites:
Expand All @@ -141,7 +146,7 @@ def fix_suite(suites):

if "s" in suite.keys():
fixed[name]["s"] = fix_suite(suite["s"])

if "t" in suite.keys():
fixed[name]["t"] = fix_tests(suite["t"])

Expand All @@ -150,11 +155,11 @@ def fix_suite(suites):

return fixed


def fix_all(latest):
fixed = {
"c": latest["c"],
"u": latest["u"],
"n": latest["r"]["n"],
"r": fix_suite(latest["r"]["s"]),
"a": {
"t": 0,
Expand Down Expand Up @@ -187,19 +192,58 @@ def fix_all(latest):

return fixed


def fix_file(file_name):
with open(file_name) as latest_f:
latest = json.load(latest_f)

latest_fixed = fix_all(latest)
fixed_latest = fix_all(latest)

with open(file_name, 'w') as latest_of:
json.dump(latest_fixed, latest_of, separators=(',', ':'), ensure_ascii=False)
json.dump(fixed_latest, latest_of, separators=(
',', ':'), ensure_ascii=False)

return fixed_latest


def clean_main():
with open("./refs/heads/main/results.json") as results_f:
results = json.load(results_f)
fixed_results = []
for result in results:
fixed_results.append({
"c": result["c"],
"u": result["u"],
"a": result["a"],
})

with open("./refs/heads/main/results.json", 'w') as results_of:
json.dump(fixed_results, results_of, separators=(
',', ':'), ensure_ascii=False)


def clean_old(file_name, results):
fixed_results = [{
"c": results["c"],
"u": results["u"],
"a": results["a"],
}]

with open(file_name, 'w') as results_of:
json.dump(fixed_results, results_of, separators=(
',', ':'), ensure_ascii=False)


for top, dirs, files in os.walk("./refs/tags"):
for dir in dirs:
print("Fixing " + dir)
fix_file("./refs/tags/" + dir + "/latest.json")
results = fix_file("./refs/tags/" + dir + "/latest.json")
clean_old("./refs/tags/" + dir + "/results.json", results)

if os.path.exists("./refs/tags/" + dir + "/features.json"):
os.remove("./refs/tags/" + dir + "/features.json")

print("Fixing main branch")
fix_file("./refs/heads/main/latest.json")
clean_main()
if os.path.exists("./refs/heads/main/features.json"):
os.remove("./refs/heads/main/features.json")
2 changes: 1 addition & 1 deletion test262/refs/heads/main/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/heads/main/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.10/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.10/results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"c":"a2d8f7b7dbcb0ce1e9a8ce8d20272405ee856c13","u":"896994413cad849f470cec7757c4bb7d1b4ffc12","a":{"t":38706,"o":6960,"i":5748,"p":0}}]
[{"c":"2d8f7b7dbcb0ce1e9a8ce8d20272405ee856c13b","u":"896994413cad849f470cec7757c4bb7d1b4ffc12","a":{"t":38507,"o":6943,"i":5747,"p":8143}}]
2 changes: 1 addition & 1 deletion test262/refs/tags/v0.11/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.11/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.12/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.12/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.13/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.13/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.14/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.14/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.15/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.15/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.16/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.16/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.1/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.1/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.2/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.2/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.3/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17.3/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17/latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test262/refs/tags/v0.17/results.json

Large diffs are not rendered by default.

0 comments on commit 3a27e1d

Please sign in to comment.