[so] [SO][Tema2][Linux]Diferente output checker vs. rulare "de mana"

Razvan Crainea razvan.crainea at gmail.com
Tue Apr 4 12:33:29 EEST 2017


Bună, Andreea!

În toate cele 3 teste care pică este folosit operatorul pipe '|'. Ai
încercat să rulezi o comandă care folosește pipe în mini-shell-ul tău?
Funcționează corect?

Numai bine,
Răzvan

On Tue, Apr 4, 2017 at 10:56 AM Andreea Dobroteanu <
andreea.dobroteanu at gmail.com> wrote:

> Buna,
>
>
> Spre exemplu, output-ul pentru testul 10, ruland checker-ul, este:
> 128
> 1
> 2
> 2
> 1
> 1
> 2
> 2
> 1
> 1
> 2
> 2
> 1
> 2
> 2
> 1
> 3
> 3
> 1
> 3
> 3
> 1
> 2
> 2
> 1
> 2
> 2
> 1
> 2
> 2
> 1
> 2
> 2
>
> "Checker-ul" improvizat de mine arata cam asa:
>
> #!/bin/bash
>
> rm -rf "test_outputs"
>
> MAIN_TEST_DIR="test_outputs"
> INPUT_DIR="_test/inputs"
> TEST_TIMEOUT=30
> BUFFERING_WRAPPER=""
> LOG_FILE="/dev/null"
>
> function execute_cmd {
>        EXEC=$1
>        INPUT=$2
>        OUTPUT=$3
>        mkdir -p "$MAIN_TEST_DIR/$OUTPUT" && cd "$MAIN_TEST_DIR/$OUTPUT" &>
> $LOG_FILE
>        timeout $TEST_TIMEOUT $BUFFERING_WRAPPER $EXEC < "${INPUT}"
>        sync
>        cd - &> $LOG_FILE
> }
>
> execute_cmd "../../mini-shell" "../../_test/inputs/test_01.lin.txt"
> "test_01_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_02.lin.txt"
> "test_02_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_03.txt"
> "test_03_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_04.lin.txt"
> "test_04_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_05.txt"
> "test_05_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_06.txt"
> "test_06_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_07.lin.txt"
> "test_07_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_08.txt"
> "test_08_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_09.txt"
> "test_09_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_10.txt"
> "test_10_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_11.txt"
> "test_11_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_12.txt"
> "test_12_out" > $LOG_FILE
> execute_cmd "../../mini-shell" "../../_test/inputs/test_13.txt"
> "test_13_out" > $LOG_FILE
>
>
> Iar cu asta, output-ul obtinut in "test_outputs/test_10_out" este *3 *(rezultatul
> difera din cauza contextului diferit in care am rulat).
> Daca rulez *../../../mini-shell < ../../inputs/test_10.txt* in *_test/outputs/test_10_out,
> *obtin *4*, rezultatul din ref.
>
>
> Practic, inca nu imi trec testele cu checker-ul default (
> run_all.sh/run_test.sh); nu am incercat sa il modific, doar am creat
> bash-ul de mai sus, pentru testare (am pus pana la 13, pentru ca celelate
> teste imi trec cu checker-ul, deci pana aici ma interesau diferentele).
>
>
> Multumesc
>
> 2017-04-04 10:18 GMT+03:00 Razvan Crainea <razvan.crainea at gmail.com>:
>
> Bună, Andreea!
>
> Definește, te rog, "output dubios". Ce anume obții?
> De asemenea, ce anume ai modificat astfel încât să treacă toate testele
> până la testul 13?
>
> Numai bine,
> Răzvan
>
> On Mon, Apr 3, 2017 at 11:53 PM Andreea Metalbrain via so <
> so at cursuri.cs.pub.ro> wrote:
>
> Sunt Andreea Dobroteanu, 331CA (imi cer scuze, nu mi-am mai dat seama ca
> am avut alt nume pe contul de gmail).
>
> 2017-04-03 23:49 GMT+03:00 Andreea Metalbrain <
> andreea.dobroteanu at gmail.com>:
>
> Buna,
>
>
> Am o problema cu checker-ul: daca rulez testele cu ./run_all.sh
> (checker-ul), obtin un output dubios pentru testele 9, 10 si 13.
>
> Insa daca rulez testele "de mana", output-ul este la fel cu cel din ref.
>
> Am incercat sa fac un micut script (inspirat din functia execute_cmd din
> run_test.sh), sa rulez toate testele pana la 13, iar rezultatul este corect.
>
> Am incarcat codul pe gitlab. (insa nu stiu cui ar trebui sa ii dau acces).
>
>
> Nu reusesc deloc sa imi dau seama de unde poate aparea problema :(
>
> Ma poate ajuta cineva?
>
>
> Multumesc
>
>
> _______________________________________________
> http://ocw.cs.pub.ro/courses/so/info/lista-discutii
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20170404/4ff9c068/attachment.html>


More information about the so mailing list