emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to add a test?
       [not found] <mailman.121.1456506036.25421.emacs-orgmode@gnu.org>
@ 2016-02-28 11:28 ` George M Jones
  2016-02-28 15:10   ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: George M Jones @ 2016-02-28 11:28 UTC (permalink / raw)
  To: emacs-orgmode

What's the process for adding a test (specifically to babel)?

The only part that looks non-obvious is how to generate the test ID,
e.g. in ob-shell-test.org:

  * Associative array tests (simple map)
    :PROPERTIES:
    :ID:       bec1a5b0-4619-4450-a8c0-2a746b44bf8d
    :END:

From there it looks like you just add to the correct file in
org-mode/testing/examples/*.org and the corresponding
/org-mode/testing/lisp/test-*.el file.  Am I missing anything?

I'll add to the README or docs unless it's already there.

Thanks,
---George Jones 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to add a test?
  2016-02-28 11:28 ` How to add a test? George M Jones
@ 2016-02-28 15:10   ` Nicolas Goaziou
  2016-02-29 16:40     ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-02-28 15:10 UTC (permalink / raw)
  To: George M Jones; +Cc: emacs-orgmode

Hello,

George M Jones <eludom@gmail.com> writes:

> What's the process for adding a test (specifically to babel)?
>
> The only part that looks non-obvious is how to generate the test ID,
> e.g. in ob-shell-test.org:
>
>   * Associative array tests (simple map)
>     :PROPERTIES:
>     :ID:       bec1a5b0-4619-4450-a8c0-2a746b44bf8d
>     :END:
>
> From there it looks like you just add to the correct file in
> org-mode/testing/examples/*.org and the corresponding
> /org-mode/testing/lisp/test-*.el file.  Am I missing anything?
>
> I'll add to the README or docs unless it's already there.

I suggest to stay away from examples/ and `org-test-at-id' altogether.
I find these tests horrible to debug when something goes wrong.

I suggest to stay with `org-test-with-temp-text', or, if needed,
`org-test-with-temp-text-in-file' and make the test self-contained.
Also, I think it is better to have only one `should' or related, outside
of this macro, so the whole test is easier to evaluate partially. See,
e.g., "test-org-footnote.el".

Obviously YMMV and the more important thing is to have more tests. How
tests are written is a lesser matter. Feel free to ignore my
suggestions.

Thank you for your work.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to add a test?
  2016-02-28 15:10   ` Nicolas Goaziou
@ 2016-02-29 16:40     ` John Kitchin
  0 siblings, 0 replies; 3+ messages in thread
From: John Kitchin @ 2016-02-29 16:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, George M Jones

In support of Nicolas' recommendations you may also find some test
examples with the macros he suggested here:

https://github.com/jkitchin/org-ref/tree/master/test

Over the past week I have been integrating tests on org-ref using some
of those macros. They are pretty easy to use.

Nicolas Goaziou writes:

> Hello,
>
> George M Jones <eludom@gmail.com> writes:
>
>> What's the process for adding a test (specifically to babel)?
>>
>> The only part that looks non-obvious is how to generate the test ID,
>> e.g. in ob-shell-test.org:
>>
>>   * Associative array tests (simple map)
>>     :PROPERTIES:
>>     :ID:       bec1a5b0-4619-4450-a8c0-2a746b44bf8d
>>     :END:
>>
>> From there it looks like you just add to the correct file in
>> org-mode/testing/examples/*.org and the corresponding
>> /org-mode/testing/lisp/test-*.el file.  Am I missing anything?
>>
>> I'll add to the README or docs unless it's already there.
>
> I suggest to stay away from examples/ and `org-test-at-id' altogether.
> I find these tests horrible to debug when something goes wrong.
>
> I suggest to stay with `org-test-with-temp-text', or, if needed,
> `org-test-with-temp-text-in-file' and make the test self-contained.
> Also, I think it is better to have only one `should' or related, outside
> of this macro, so the whole test is easier to evaluate partially. See,
> e.g., "test-org-footnote.el".
>
> Obviously YMMV and the more important thing is to have more tests. How
> tests are written is a lesser matter. Feel free to ignore my
> suggestions.
>
> Thank you for your work.
>
>
> Regards,


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-29 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.121.1456506036.25421.emacs-orgmode@gnu.org>
2016-02-28 11:28 ` How to add a test? George M Jones
2016-02-28 15:10   ` Nicolas Goaziou
2016-02-29 16:40     ` John Kitchin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).