diff options
author | Rodrigo Alejandro Melo <rmelo@inti.gob.ar> | 2020-02-06 10:45:40 -0300 |
---|---|---|
committer | Rodrigo Alejandro Melo <rmelo@inti.gob.ar> | 2020-02-06 10:45:40 -0300 |
commit | 9da5936c0555de28fc9d254242bd2a33b3399ad6 (patch) | |
tree | d19c1b299b258357d15b65b31c085f7bdb011ab5 /tests/memfile | |
parent | da485dc007b4dd9f72b8682a6809627e1f04513a (diff) | |
download | yosys-9da5936c0555de28fc9d254242bd2a33b3399ad6.tar.gz yosys-9da5936c0555de28fc9d254242bd2a33b3399ad6.tar.bz2 yosys-9da5936c0555de28fc9d254242bd2a33b3399ad6.zip |
Added 'set -e' into tests/memfile/run-test.sh
Also added two checks for situations where the execution must fail.
Signed-off-by: Rodrigo Alejandro Melo <rmelo@inti.gob.ar>
Diffstat (limited to 'tests/memfile')
-rwxr-xr-x | tests/memfile/run-test.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/memfile/run-test.sh b/tests/memfile/run-test.sh index f25a8e0b1..e43ddd093 100755 --- a/tests/memfile/run-test.sh +++ b/tests/memfile/run-test.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + mkdir -p temp cp content1.dat temp/content2.dat @@ -27,3 +29,21 @@ echo "Running from a child directory with temp/content2.dat" ../../../yosys -qp "read_verilog -defer ../memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory" echo "Running from a child directory with content2.dat" ../../../yosys -qp "read_verilog -defer ../memory.v; chparam -set MEMFILE \"temp/content2.dat\" memory" + +cd .. + +echo "Checking a failure when zero length filename is provided" +if ../../yosys -qp "read_verilog memory.v"; then + echo "The execution should fail but it didn't happen, which is WRONG." + exit 1 +else + echo "Execution failed, which is OK." +fi + +echo "Checking a failure when not existing filename is provided" +if ../../yosys -qp "read_verilog -defer memory.v; chparam -set MEMFILE \"content3.dat\" memory"; then + echo "The execution should fail but it didn't happen, which is WRONG." + exit 1 +else + echo "Execution failed, which is OK." +fi |