A recent conversation with my brother speed got me thinking about how
to improve Leo's unit testing.

Best practice is to develop all code using unit tests.  Speed has a
workflow that allows him to do this using the alt-5, run-unit-tests
command.  This isn't possible if all unit tests reside in
unitTest.leo.

I hope Speed will describe here his work flow in detail, but in the
meantime I thought I would experiment with another idea.

For each .leo file, say x.leo, create, within x.leo, the following
tree:

- Testing
  - Unit Tests
    - @thin test_x.txt
      - @unit-tests
        - @test 1
        - @test 2
        - @suite 1
        etc.
  - Local Tests
    - Script 1

The root node of test_x.txt contains just an @all directive.

With this organization I can run all @test and @suite nodes with
alt-5.  These tests will run in an external process with the last
saved code in x.leo.

Aside: the local tests tree will contain by-hand test scripts.  They
aren't executed by alt-5.  This tree could be omitted if you like.

With this scheme I can clone any @test node and put it next to the
code I am working on.  I am doing this while I work on
c.vnode2position.

I plan to create test_gui.txt and test_core.txt, and possibly
test_plugins.txt.

It should be possible to put @thin test_core.txt and @thin
test_gui.txt in unitTest.leo.  This would allow unitTests.leo to run
all unit tests as before. There is the risk of running afoul of the
multiple-update problem, but this risk is probably worth taking.

Edward
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to