Code Monkey home page Code Monkey logo

vunit-mode's People

Contributors

embed-me avatar gmlarumbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vunit-mode's Issues

Simulating test case under curser doesn't work with zsh as shell

First off, I am using spacemacs, but this bug probably also applies to other emacs configurations.

The problem is, that zsh is trying to expand the testcase parameter to the vunit script, if it contains an asterisk.
This is the case, if either all testcases in the buffer, or the testcase under the cursor should be simulated.

Sample Testbench:

library vunit_lib;
context vunit_lib.vunit_context;

entity tb_simple_test is
	generic (runner_cfg: string := runner_cfg_default);
end entity;

architecture tb of tb_simple_test is
begin
	test_runner: process
	begin
		test_runner_setup(runner, runner_cfg);

        while test_suite loop
            if run("testcase_1") then         -- define one VUnit testcase
                check(5 = 5, "Arithmetic is broken");
            end if;
        end loop;

        test_runner_cleanup(runner);
	end process;
end architecture;

Output of trying to simulate the single testcase with vunit-mode (I replaced my project dir with PROJDIR):

python PROJDIR/vunit/run.py *.testcase_1 --output-path PROJDIR/vunit/vunit_out --no-color --num-threads 1 
zsh:1: no matches found: *.testcase_1

Possible fix/workaround:

I have modified the format call in my local vunit-mode.el, so that it surrounds the parameter with ' '.
(Line 165 for the cursor option)

(defun vunit-sim-cursor ()
  "Simulate testcase at cursor."
  (interactive)
  (with-current-buffer (buffer-name)
    (save-excursion
      (if (not (vunit--match-line))
          (re-search-backward vunit--regex-testcase nil 'noerror))
      (if (vunit--match-line)
-          (vunit--run (format "*.%s" (vunit--match-line)))
+          (vunit--run (format "'*.%s'" (vunit--match-line)))
        (message "No testcase...")))))

Which seems to work, at least on my machine. I don't know if this will have side effects on other shells

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.