【发布时间】:2021-10-14 07:38:33
【问题描述】:
我的 makefile 中有这个:
test_x_number_times:
for time in `seq $(TIMES)` ; do \
for dc in $(DCs) ; do \
echo $$dc ; \
poetry run kit test -d $$dc --testcase-id=$(TESTCASES) || true ; \
done ; \
done ;
并希望能够为TESTCASES 和DCs 传递多个值,以便我可以在for 循环中遍历它们,但我不知道如何在命令行中列出参数一种将值视为可以迭代的值的方式。这是我尝试过的:
- make test_x_number_times TIMES=1 DCs=B1,G1 TESTCASES=1,2
- make test_x_number_times TIMES=1 DCs=B1 G1 TESTCASES=1 2
- make test_x_number_times TIMES=1 DCs=(B1 G1) TESTCASES=(1 2)
我该怎么做?我在文档或 stackoverflow 的任何地方都找不到它。
【问题讨论】:
标签: loops makefile command-line