Support colorized output with -O
Using -O allows grouping job output, which is helpful when output would otherwise be interleaved (such as when running tests). However, it also means that there is no tty attached to the job, resulting in cocotb automatically turning off color. Detect whether we have a tty during the parsing phase, and force color output if we do. Technically this should probably take into account the existing value of COCOTB_ANSI_OUTPUT, but I don't use it normally. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
897326dbdb
commit
50c1080ba4
5
Makefile
5
Makefile
|
@ -48,6 +48,11 @@ export LIBPYTHON_LOC := $(shell cocotb-config --libpython)
|
||||||
VVPFLAGS := -M $(shell cocotb-config --lib-dir)
|
VVPFLAGS := -M $(shell cocotb-config --lib-dir)
|
||||||
VVPFLAGS += -m $(shell cocotb-config --lib-name vpi icarus)
|
VVPFLAGS += -m $(shell cocotb-config --lib-name vpi icarus)
|
||||||
|
|
||||||
|
# Always use color output if we have a tty. This allows for easy use of -O
|
||||||
|
ifeq ($(shell test -c /dev/stdin && echo 1),1)
|
||||||
|
export COCOTB_ANSI_OUTPUT=1
|
||||||
|
endif
|
||||||
|
|
||||||
define run-vvp =
|
define run-vvp =
|
||||||
MODULE=tb.$* $(VVP) $(VVPFLAGS) $< -fst +vcd=$@
|
MODULE=tb.$* $(VVP) $(VVPFLAGS) $< -fst +vcd=$@
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Reference in New Issue