run-docker-test 590 Bytes
Newer Older
1 2 3 4 5 6
#!/bin/bash

#
# Run docker with vunit and ghdl with current directory mounted in /build.
# It is ready to run tests via, for example, `make test_fast coverage`
#
7 8 9
# Can also be run directly with command to run:
#   ./run-docker-test make test_fast
#
10 11 12 13 14 15 16

if [ -d /build ]; then
    export PATH=/opt/ghdl/bin:$PATH
    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8
    export PYTHONUNBUFFERED=1
    cd /build/test
17 18 19 20 21
    if [ $# -gt 0 ]; then
        exec "$@"
    else
        exec bash
    fi
22
else
23
    docker run --rm -ti -v $PWD:/build mjerabek/ghdl:upstream-gcc /build/run-docker-test "$@"
24 25
fi