そのため、Mavenタスクの引数として提供されているテストファイルを使用して、一連の(Maven)テストを実行する必要があります。
このようなもの:
mvn clean test -Dtest=<filename>
また、テストファイルは通常、さまざまなディレクトリに編成されています。したがって、上記の「コマンド」を実行し、指定されたディレクトリ内のすべてのファイルの名前をに自動的にフィードするスクリプトを作成しようとしています-Dtest
。
そこで、「run_test」というシェルスクリプトから始めました。
#!/bin/sh
if test $# -lt 2; then
echo "$0: insufficient arguments on the command line." >&1
echo "usage: $0 run_test dirctory" >&1
exit 1
fi
for file in allFiles <<<<<<< what should I put here? Can I somehow iterate thru the list of all files' name in the given directory put the file name here?
do mvn clean test -Dtest= $file
exit $?
私が行き詰まった部分は、ファイル名のリストを取得する方法です。ありがとう、