fold up individual output by default
This commit is contained in:
parent
530348da01
commit
b83ba8acb1
1 changed files with 20 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import collections
|
import collections
|
||||||
|
from contextlib import contextmanager
|
||||||
|
|
||||||
# optional wall option cause build failed if has warnings
|
# optional wall option cause build failed if has warnings
|
||||||
BUILD_WALL = False
|
BUILD_WALL = False
|
||||||
|
|
@ -310,6 +311,20 @@ for arg in sys.argv[1:]:
|
||||||
print("Unknown platform: ", arg)
|
print("Unknown platform: ", arg)
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
|
@contextmanager
|
||||||
|
def group_output(title):
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stderr.flush()
|
||||||
|
print(f"::group::{title}")
|
||||||
|
try:
|
||||||
|
yield
|
||||||
|
finally:
|
||||||
|
sys.stdout.flush()
|
||||||
|
sys.stderr.flush()
|
||||||
|
print(f"::endgroup::")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def test_examples_in_folder(folderpath):
|
def test_examples_in_folder(folderpath):
|
||||||
global success
|
global success
|
||||||
for example in sorted(os.listdir(folderpath)):
|
for example in sorted(os.listdir(folderpath)):
|
||||||
|
|
@ -365,6 +380,7 @@ def test_examples_in_folder(folderpath):
|
||||||
ColorPrint.print_pass(CHECK)
|
ColorPrint.print_pass(CHECK)
|
||||||
if err:
|
if err:
|
||||||
# also print out warning message
|
# also print out warning message
|
||||||
|
with group_output(f"{example} {fqbn} build output"):
|
||||||
ColorPrint.print_fail(err.decode("utf-8"))
|
ColorPrint.print_fail(err.decode("utf-8"))
|
||||||
if os.path.exists(gen_file_name):
|
if os.path.exists(gen_file_name):
|
||||||
if ALL_PLATFORMS[platform][1] == None:
|
if ALL_PLATFORMS[platform][1] == None:
|
||||||
|
|
@ -382,6 +398,7 @@ def test_examples_in_folder(folderpath):
|
||||||
os.system("ls -lR "+BUILD_DIR+"/build")
|
os.system("ls -lR "+BUILD_DIR+"/build")
|
||||||
else:
|
else:
|
||||||
ColorPrint.print_fail(CROSS)
|
ColorPrint.print_fail(CROSS)
|
||||||
|
with group_output(f"{example} {fqbn} built output"):
|
||||||
ColorPrint.print_fail(out.decode("utf-8"))
|
ColorPrint.print_fail(out.decode("utf-8"))
|
||||||
ColorPrint.print_fail(err.decode("utf-8"))
|
ColorPrint.print_fail(err.decode("utf-8"))
|
||||||
success = 1
|
success = 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue