verilator/test_regress/t/t_flag_help.py

36 lines
1.2 KiB
Python
Raw Normal View History

2024-09-08 17:00:03 +00:00
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2024 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
import vltest_bootstrap
test.scenarios('dist')
# See also t_flag_version.py
def check(prog):
2024-09-08 17:00:03 +00:00
logfile = test.obj_dir + "/t_help__" + os.path.basename(prog) + ".log"
test.run(fails=False, cmd=[prog, "--help"], logfile=logfile, tee=False, verilator_run=True)
2024-09-08 17:00:03 +00:00
test.file_grep(logfile, r'(DISTRIBUTION|usage:)')
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator")
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator_coverage")
2024-09-08 17:00:03 +00:00
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator_ccache_report")
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator_gantt")
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator_profcfunc")
2024-09-08 17:00:03 +00:00
if os.path.exists(os.environ["VERILATOR_ROOT"] + "/bin/verilator_difftree"):
check(os.environ["VERILATOR_ROOT"] + "/bin/verilator_difftree")
2024-09-08 17:00:03 +00:00
test.passes()