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.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

How do I let ert know where my tests are defined?

What I'm doing: If I define a test like: (ert-deftest tmp-test () "failing test" :expected-result :failed (should (eql (+ 1 0) 2))) and then I run M-x ert-run-tests-automatically ;; ...
0
votes
1answer
17 views

What is the equivalent of Ruby's “rake test” for project elfeed?

In a ruby/rails project, the "standard" way to run "the test suite" is rake # alias for rake test Some projects will mention (when there's a deviation)how to run tests in their README. How do you ...
0
votes
1answer
33 views

Testing Emacs Lisp Code Involving Org Mode

I'm trying to figure out how I can use ERT and libraries like el-mock to test simple functions that manipulate my org-document. Consider a function like this: (defun promote-next-heading () (org-...
0
votes
0answers
116 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 ...
5
votes
1answer
483 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
92 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
97 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
124 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 ...
5
votes
2answers
414 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
66 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
119 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
117 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
90 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
76 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
209 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
532 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
74 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
816 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 ...