diff --git a/.github/workflows/compile-and-test.yml b/.github/workflows/compile-and-test.yml index ce4f9f5..e72cb33 100644 --- a/.github/workflows/compile-and-test.yml +++ b/.github/workflows/compile-and-test.yml @@ -17,12 +17,20 @@ jobs: uses: actions/checkout@v3 - name: Make `makefile.sh` executable +<<<<<<< HEAD run: | chmod +x makefile.sh - name: Run `makefile.sh` to prepare Makefile run: | ./makefile.sh delete +======= + run: chmod +x makefile.sh + + - name: Run `makefile.sh` to prepare Makefile + run: | + ./makefile.sh +>>>>>>> 74e49f5ae5a7d912cdff72dc4a1573944672c1e8 if [ $? -ne 0 ]; then echo "::error::makefile.sh failed" exit 1 @@ -45,6 +53,7 @@ jobs: exit 1 fi +<<<<<<< HEAD for file in t/*; do echo "Testing with file: $file" @@ -54,4 +63,31 @@ jobs: echo "::error::Test failed for $file" exit 1 fi - done \ No newline at end of file + done +======= + # Проверяем, что папка с тестами есть: + if [ ! -d "t" ]; then + echo "::error::No directory 't' with test files" + exit 1 + fi + + for f in t/*; do + echo "=======================" + echo "Testing with file: $f" + + # Создаём файл с вводом + echo "0" > input.txt + echo "$f" >> input.txt + + echo "DEBUG: cat -A input.txt" + cat -A input.txt # Посмотреть, нет ли там ^M + + ./a.out < input.txt + status=$? + + if [ $status -ne 0 ]; then + echo "::error::Test failed for $f" + exit 1 + fi + done +>>>>>>> 74e49f5ae5a7d912cdff72dc4a1573944672c1e8