Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [testing]

Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results.

0
votes
0answers
114 views

How do you run tests in anaconda mode?

Elpy has support for running test using your test runner. Looking at anaconda it does not seem to do the same functionality is there a package that can detect all your tests and let you run them ...
6
votes
1answer
433 views

Debug pytests in emacs

I try to debug my pytest-cases like this: import pytest def test_something() ... ... pytest.set_trace() Then, i execute the tests by running elpy-test. The test starts to run and stops ...
0
votes
1answer
85 views

How to run rspec from the emacs shell?

I'm following an entry-level tutorial on rspec here, and I've created a very simple test at spec\lib\zombie_spec.rb: require "spec_helper" describe "A Zombie" do #Your 'examples' (tests) go here. ...
1
vote
1answer
94 views

Why does running my tests with ert-run-tests-batch-and-exit fail

I have written a few simple tests, when I run them on the buffer inside emacs everything passes. However, when I run them in batch mode as shown below, it fails. What can explain this? emacs -batch -...
2
votes
1answer
117 views

How do I temporarily mock a function for testing?

I'd like to patch some elisp functions inside my unit tests. I've tried cl-labels and cl-flet, but neither achieve the result I want: (defun return-number () 1) (defun calls-return-number () (...
0
votes
0answers
50 views

Mutation testing for Emacs Lisp

What is the practice of mutation testing in Emacs Lisp? Source file in question is haskell-indentation.el with test suite in haskell-indentation-tests.el There are quite some strings in haskell-...
3
votes
0answers
50 views

Emacs Lisp performance regression testing

I'm trying to find a way to implement ERT tests for performance of some elisp code. For that to work I need to have a stable performance metric. Is there a stable performance metric I could use? It ...
6
votes
2answers
380 views

How can I quickly switch between source namespace and test namespace?

In Cider, I can use C-c , to run the tests for the current namespace. This will work whether I'm currently in the source namespace or the test namespace itself (and indeed, this magic behavior is ...
1
vote
2answers
64 views

Compile-run-navigate traceback without term mode

I have experimented with emacs' various shells (term in combination with compilation-mode in particular), and have had performance problems. For that reason I still use a separate terminal (e.g. ...
2
votes
1answer
115 views

Find corresponding test file

Newbie question here. In intellij there is Ctrl-Shift T to go to the corresponding test file. (For java at least.) I would like something similar in emacs. Something like this: For a language (or ...
0
votes
2answers
113 views

How to get current file name when running under ERT?

I have a set of tests that involve loading files from the file-system and I would like to use the current filename to locate the test files relative to the test file. The below code shows the pattern ...
2
votes
2answers
88 views

Pending test in Ert

I'm currently starting to build a package the TDD way, and for that I'm using ert, following ert-runner opinions. I would like to write a set of pending tests, to identify what I have I to test, ...
4
votes
1answer
75 views

How can I test an idle timer with ERT?

Say I have a function that is called on an idle timer: (defun tmp:create () (mkdir "test")) (run-with-idle-time 3 nil #'tmp:create) How can I test that this function works? Using something like (...
2
votes
2answers
207 views

How can I skip a test if another test failed?

Say I have two tests: (defun func-one () nil) (defun func-two () (and (func-one) t)) (ert-deftest test-one () "Test basic functionality" (should (func-one))) (ert-deftest test-two () "Test ...
4
votes
2answers
523 views

projectile-rails: run the current test

While it is easy to run the whole test suite with projectile-rails, this takes too much time. I'd like to be able to run the current test (i.e., the test point is located in) with a shortcut. Is this ...
2
votes
1answer
71 views

Accessing resource files in ERT tests

I'm trying to use ERT to test the ycmd package, and part of what I need to do is pass bodies of code to the ycmd server and ask for completion candidates. I'd like to be able to keep these bodies of ...
5
votes
3answers
796 views

Running all tests in a leiningen project?

Is there a way, via cider or some other emacs extension, to run all of the tests in a leiningen project? cider has the function cider-test-run-tests which attempts to just run the tests related to ...