aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/vhpi/004trace_stdout/testsuite.sh
diff options
context:
space:
mode:
authorMarlon James <marlon.james@gmail.com>2021-04-17 15:08:50 -0700
committertgingold <tgingold@users.noreply.github.com>2021-04-18 17:34:57 +0200
commit90ac6b099104d285babbf0bce15cd735bf790336 (patch)
treed099bc04b7d897b239b263fc9f4d7ec0ea6b01c4 /testsuite/vhpi/004trace_stdout/testsuite.sh
parente9de3601fcd8e164ffcbf8243b45619d72a4ef3a (diff)
downloadghdl-90ac6b099104d285babbf0bce15cd735bf790336.tar.gz
ghdl-90ac6b099104d285babbf0bce15cd735bf790336.tar.bz2
ghdl-90ac6b099104d285babbf0bce15cd735bf790336.zip
VHPI: add tracing tests
Diffstat (limited to 'testsuite/vhpi/004trace_stdout/testsuite.sh')
-rwxr-xr-xtestsuite/vhpi/004trace_stdout/testsuite.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/vhpi/004trace_stdout/testsuite.sh b/testsuite/vhpi/004trace_stdout/testsuite.sh
new file mode 100755
index 000000000..870aef605
--- /dev/null
+++ b/testsuite/vhpi/004trace_stdout/testsuite.sh
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze mydesign.vhdl
+elab myentity
+
+if c_compiler_is_available && ghdl_has_feature myentity vhpi; then
+ $GHDL --vpi-compile -v gcc -c vhpi_lib.c
+ $GHDL --vpi-link -v gcc -o vhpi_lib.vhpi vhpi_lib.o
+
+ add_vpi_path
+
+ simulate myentity --vhpi=./vhpi_lib.vhpi --vhpi-trace | tee myentity.out
+ if grep -q Error myentity.out; then
+ echo "Error in output"
+ exit 1;
+ fi
+ if grep -q error myentity.out; then
+ echo "error in output"
+ exit 1;
+ fi
+ if ! grep -q "vhpi_register_cb (" myentity.out; then
+ echo "VHPI trace missing"
+ exit 1;
+ fi
+ if ! grep -q "VHPI printf" myentity.out; then
+ echo "VHPI printf missing"
+ exit 1;
+ fi
+
+ rm -f vhpi_lib.vhpi vhpi_lib.o myentity.out
+fi
+clean
+
+echo "Test successful"