diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-22 15:28:31 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-10-22 15:28:31 +0200 |
| commit | 97b3aa48a8d6ccdf2a3ce587bf8ac130c00c1b64 (patch) | |
| tree | da3b5888ae7d3f1d323640b237bcc9cd61cdd865 /utils | |
| parent | 0c49ed5afc2ae9e4bc4aa1af9c655bbe1f3d14b8 (diff) | |
| download | nissy-core-97b3aa48a8d6ccdf2a3ce587bf8ac130c00c1b64.tar.gz nissy-core-97b3aa48a8d6ccdf2a3ce587bf8ac130c00c1b64.zip | |
Generated tests for transformations
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/gentranstests.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/gentranstests.sh b/utils/gentranstests.sh new file mode 100755 index 0000000..0186480 --- /dev/null +++ b/utils/gentranstests.sh | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | outdir=${1:-"../test/05_transform"} | ||
| 4 | |||
| 5 | mkdir -p "$outdir" | ||
| 6 | i=100 | ||
| 7 | |||
| 8 | while read -r line; do | ||
| 9 | [ -z "$line" ] && continue | ||
| 10 | |||
| 11 | trans_piece="$(echo $line | awk '{print $1}' | tr -d 'rm')" | ||
| 12 | move1="$(echo $line | awk '{print $2}')" | ||
| 13 | move2="$(echo $line | awk '{print $3}')" | ||
| 14 | |||
| 15 | rotation="rotation $trans_piece" | ||
| 16 | |||
| 17 | file1="$(ls | grep move_*_${move1}.txt)" | ||
| 18 | file2="$(ls | grep move_*_${move2}.txt)" | ||
| 19 | echo "$rotation" >"$outdir/${i}_${trans_piece}r_${move1}.in" | ||
| 20 | cat "$file1" >>"$outdir/${i}_${trans_piece}r_${move1}.in" | ||
| 21 | cp "$file2" "$outdir/${i}_${trans_piece}r_${move1}.out" | ||
| 22 | |||
| 23 | i=$((i+1)) | ||
| 24 | |||
| 25 | mirrored="mirrored $trans_piece" | ||
| 26 | |||
| 27 | file1="$(ls | grep move_*_${move1}.txt)" | ||
| 28 | file2="$(ls | grep move_*_${move2}.txt)" | ||
| 29 | echo "$mirrored" >"$outdir/${i}_${trans_piece}m_${move1}.in" | ||
| 30 | cat "$file1" >>"$outdir/${i}_${trans_piece}m_${move1}.in" | ||
| 31 | cp "$file2" "$outdir/${i}_${trans_piece}m_${move1}.out" | ||
| 32 | |||
| 33 | i=$((i+1)) | ||
| 34 | done <transform_moves.txt | ||
