Skip to content

pengwyn/EyeOfRa.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eye of Ra

Build Status

This package is aimed at removing the manual aspects of the typical programming change-check cycle, usually invoked by

  1. edit
  2. save
  3. <alt-tab>
  4. <up-arrow><enter>
  5. curse/scream/yell/despair
  6. <alt-tab>
  7. Continue from step 1...

Using

Invoke the macro @observe on a function call. The documentation is:

@observe func(args... ; kwds...)

Use Revise to "observe" changes to a functions behaviour. This will track the return values and the stdout/stderr of the function.

Notes:

  • This only tracks stdout, stderr output using redirect_stdxxx. Many functions (e.g. display) will not output to the current stdout and so will not be captured.
  • "Repeats" are recorded. Two calls repeat, when they have the same output.
  • Currently, any change to the function's module will cause the function to be retested.
  • This will probably only work on linux at the moment...

Example output

Success

Example with exception

Exception

Future work

  • Diffs of output and returned values.
  • Multiple input arguments to test several cases at once.
    • Option to focus on failures or focus on successes.
  • Quick option to save tests as unit tests in package.
  • Option to load tests from runtest.jl.

Inspiration

This idea was inspired by Brett Victor's talk "Inventing on Principle": https://www.youtube.com/watch?v=8QiPFmIMxFc

Emacs support

See the emacs package julia-funcobs for an IDE-like interface with julia-repl. Includes image support from Plots.jl.

Emacs

Naming

Why "Eye of Ra"?

  • Watches over.
  • Protective.
  • Can get "out of control".
  • Horus always gets the attention.

About

Continuous testing while developing functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages