Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Testing fix for suoto/hdl_checker/issues/4
Browse files Browse the repository at this point in the history
  • Loading branch information
suoto committed Mar 29, 2016
1 parent e9c3c47 commit e843302
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 99 deletions.
19 changes: 12 additions & 7 deletions .ci/tests/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _getVroomArgs():
def _getBashPair(path):
return path.replace('.vroom', '.sh')

TESTS_ALLOWED_TO_FAIL = ['test_004_issue_10',]
TESTS_ALLOWED_TO_FAIL = [] #'test_004_issue_10',]

def main(tests=None):
test_dir = p.dirname(p.abspath(__file__))
Expand All @@ -55,18 +55,23 @@ def main(tests=None):
test_name = p.basename(vroom_test).replace('.vroom', '')
bash_path = _getBashPair(vroom_test)

test_passed = False
if p.exists(bash_path):
subp.check_call([bash_path, ] + _getVroomArgs())
test_passed = True
else:
try:
subp.check_call(['vroom', vroom_test, ] + _getVroomArgs())
passed += [test_name]
test_passed = True
except subp.CalledProcessError:
# We'll allow test 004 to fail for now
if test_name in TESTS_ALLOWED_TO_FAIL:
allowed_to_fail += [test_name]
else:
failed += [test_name]
pass

if test_passed:
passed += [test_name]
elif test_name in TESTS_ALLOWED_TO_FAIL:
allowed_to_fail += [test_name]
else:
failed += [test_name]

# os.system('reset')
if passed:
Expand Down
3 changes: 2 additions & 1 deletion .ci/tests/test_004_issue_10.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

set -x
./dependencies/hdlcc/hdlcc/runner.py .ci/test_projects/hdl_lib/ghdl.prj -cb -vvv
# We'll run hdlcc standalone executable, we should have installed this first
hdlcc .ci/test_projects/hdl_lib/ghdl.prj -cb -vvv
vroom "$@" .ci/tests/test_004_issue_10.vroom

87 changes: 2 additions & 85 deletions .ci/tests/test_004_issue_10.vroom
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Macro that checks if vimhdl is enabled



Edit different files under the same project
Edit some files on Vim after using hdlcc_sa.py to build outside Vim
:cd .ci/test_projects/hdl_lib
:let g:vimhdl_conf_file = 'ghdl.prj'
:edit common_lib/edge_detector.vhd
@do (vimhdl_check)

Again, this file has no errors
This file has no errors
@do (assert_qf_empty)

Remove an important line so the builder must tell there's an error
Expand All @@ -48,86 +48,3 @@ Remove an important line so the builder must tell there's an error
:write
@do (assert_qf_empty)



Ok, so the previous file worked fine. Let's open another file that our edge_detector
depends on, like the sr_delay
:edit common_lib/sr_delay.vhd
Again, this file has no errors
:write
@do (assert_qf_empty)

Let's rename the 'clken' port to 'clk_en'
:%s/\<clken\>/clk_en/g
This won't cause errors for this file
:write
@do (assert_qf_empty)



But our edge detector should warn that a port named 'clken' doens't exist
anymore
:edit common_lib/edge_detector.vhd
:write
~ ".*".*\swritten (regex)
:lopen
common_lib/edge_detector.vhd|75 col 24 error| no interface for 'clken' in association
:lclose

Let's undo our changes
:edit common_lib/sr_delay.vhd
:%s/\<clk_en\>/clken/g
:write
~ ".*".*\swritten (regex)
@do (assert_qf_empty)

Again, this should propagate
:edit common_lib/edge_detector.vhd
:write
~ ".*".*\swritten (regex)
@do (assert_qf_empty)



We'll edit a packge that both sr_delay and the edge_detector depend. Let's see
what happens!
:edit common_lib/common_pkg.vhd
@do (assert_qf_empty)
:10
> o constant SOME_CONSTANT : integer := 14<ESC>
:write
~ ".*".*\swritten (regex)
:SyntasticCheck
:lopen
common_lib/common_pkg.vhd|12 col 5 error| ';' is expected instead of 'function'
:q

> a;<ESC>
:write
~ ".*".*\swritten (regex)
@do (assert_qf_empty)


The package has changed but neither the edge_detector or sr_delay have been
rebuilt
:edit common_lib/edge_detector.vhd
:write
@do (assert_qf_empty)

Let's rebuild
:edit common_lib/synchronizer.vhd
:write
@do (assert_qf_empty)

Let's rebuild
:edit common_lib/sr_delay.vhd
:write
@do (assert_qf_empty)


The package has changed but neither the edge_detector or sr_delay have been
rebuilt
:edit common_lib/edge_detector.vhd
:write
@do (assert_qf_empty)

11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
global:
- VROOM_TAG=v0.12.0
# - GRLIB_VERSION=v1.5.0-b4164
- GRLIB_VERSION=v1.5.0-b4164
- GRLIB_VERSION=v1.4.1-b4156
- CACHE=${HOME}/cache"
- GHDL_HOST="http://downloads.sourceforge.net/project/ghdl-updates/Builds"
- GHDL_URL ="${GHDL_HOST}/ghdl-0.33/ghdl-0.33-x86_64-linux.tgz"
Expand All @@ -21,7 +21,7 @@ env:
# - VIM_VERSION=v7.4.712 # Ubuntu wily
# - VIM_VERSION=v7.4.963 # Ubuntu 15.10
- VIM_VERSION=v7.4.1593 # Latest Vim version working with Vroom currently
# - VIM_VERSION=master
- VIM_VERSION=master

addons:
apt:
Expand All @@ -33,6 +33,7 @@ addons:
install:
- pip install -r ./.ci/requirements.txt
- pip install -r ./dependencies/hdlcc/requirements.txt
- pip install ./dependencies/hdlcc/

before_script:
- "mkdir -p ${CACHE}"
Expand All @@ -49,20 +50,20 @@ before_script:

# Download grlib from aeroflex
- "git clone https://github.com/suoto/grlib -b ${GRLIB_VERSION} \
--single-branch --depth 1"
--single-branch --depth 1 ~/grlib/"

- "export VIMRUNTIME=${CACHE}/vim-${VIM_VERSION}/runtime"
- "export PATH=${CACHE}/vim-${VIM_VERSION}/src/:${PATH}"
- "export VIM_BINARY=${CACHE}/vim-${VIM_VERSION}/src/vim"

- "./dependencies/hdlcc/scripts/setup_ghdl.sh"
- "./dependencies/hdlcc/.ci/scripts/setup_ghdl.sh"
- "./.ci/setup_ghdl.sh"
- "./.ci/setup_vim.sh"
- "[ -n \"$VIM_BINARY\" ] || exit -1"
- "$VIM_BINARY --version"

script:
- ./run_tests.sh -d0.5 -t3
- ./run_tests.sh

after_success:
- "rm -f .ci/test_projects/hdl_lib/osvvm_lib/CoveragePkg.vhd"
Expand Down
2 changes: 1 addition & 1 deletion dependencies/hdlcc
Submodule hdlcc updated from c10e65 to e135ef

0 comments on commit e843302

Please sign in to comment.