在 TCL 中执行测试

Executing a test in TCL

我是 TCL 的新手,但我正在编写一个脚本,该脚本将在文件中搜索测试用例并过滤掉具有特定关键字的测试用例,运行 这些测试使用 exec。它 运行 的第一个测试很好,但是一旦它完成它就开始再次 运行 相同的测试并立即失败导致我的脚本结束。这是脚本的样子运行是一个测试

exec make clean
exec make depends
set runtests [exec bsub -I -q lin_i make test_run_test_here SEED=1 VPDDUMP=on]
set test [lsearch -all -inline $runtest "TEST COMPLETED SUCCESSFULLY: test_run_test_here"]
puts $test

它 运行 通过测试正常,但在我收到此消息后

<<Waiting for dispatch ...>>
<<Starting on testserver01>>
    while executing
"exec bsub -I -q lin_i make test_run_test_here SEED=1 VPDDUMP=on"
    invoked from within
"set runtests [exec bsub -I -q lin_i make test_run_test_here SEED=1 VPDDUMP=on]"
    (file "./test.tcl" line 71)

如果调用的命令向 stderr 输出任何内容,exec 命令认为它失败,即使它具有成功的退出状态:

If any of the commands writes to its standard error file and that standard error is not redirected and -ignorestderr is not specified, then exec will return an error;

您想使用 -ignorestderr 选项。

set runtests [exec -ignorestderr bsub ...