mirror of
https://github.com/servo/servo.git
synced 2025-06-08 16:43:28 +00:00
Devtools parser: reassemble fragmented messages (#36033)
* Devtools parser: reassemble fragmented messages Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com> Signed-off-by: Delan Azabani <dazabani@igalia.com> * Enable devtools parser tests on Linux only for now Signed-off-by: Delan Azabani <dazabani@igalia.com> --------- Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com>
This commit is contained in:
parent
5d1c64dba9
commit
2c94110952
4 changed files with 147 additions and 25 deletions
|
@ -13,6 +13,7 @@ import re
|
|||
import sys
|
||||
import os
|
||||
import os.path as path
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import textwrap
|
||||
|
@ -291,6 +292,25 @@ class MachCommands(CommandBase):
|
|||
print("Running WPT tests...")
|
||||
passed = wpt.run_tests() and passed
|
||||
|
||||
print("Running devtools parser tests...")
|
||||
# TODO: Enable these tests on other platforms once mach bootstrap installs tshark(1) for them
|
||||
if platform.system() == "Linux":
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["etc/devtools_parser.py", "--json", "--use", "etc/devtools_parser_test.pcap"],
|
||||
check=True, capture_output=True)
|
||||
expected = open("etc/devtools_parser_test.json", "rb").read()
|
||||
actual = result.stdout
|
||||
assert actual == expected, f"Incorrect output!\nExpected: {repr(expected)}\nActual: {repr(actual)}"
|
||||
print("OK")
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Process failed with exit status {e.returncode}: {e.cmd}", file=sys.stderr)
|
||||
print(f"stdout: {repr(e.stdout)}", file=sys.stderr)
|
||||
print(f"stderr: {repr(e.stderr)}", file=sys.stderr)
|
||||
raise e
|
||||
else:
|
||||
print("SKIP")
|
||||
|
||||
if all or tests:
|
||||
print("Running WebIDL tests...")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue