This is a simple Julia app with a single type, a single function, and a single test suite.
This app is intended to be used as a template for creating new Julia applications.
Tests should be defined in modules.
These modules are loaded in your current environment stack (i.e. in the LOAD_PATH
variable) at the beginning of the runtests.jl
script.
This operation is needed to track changes and run the tests easily.
The revise-test loop is a handy workflow for Julia development :
- You make changes to your code (current pkg and tests)
- Revise.jl automatically detect those changes
- It runs tests immediately to verify your changes work correctly
- You continue development without restarting Julia
This workflow significantly speeds up development by eliminating the need to restart Julia sessions between code changes.
Run the ./runtests.sh
script to start the revise-test loop.
You need to edit the test/runtests.jl
file to configure the revise-test loop:
- Step 1 (automatic): The script automatically puts all test modules in the
LOAD_PATH
- Step 2 (manual): Import your Application module
using EmptyPackage
- Step 3 (manual): Import all test modules
using EmptyPackageUnitTests
- Step 4 (manual): List in
MODULES_TO_TRACK
the modules to track for changesMODULES_TO_TRACK = [EmptyPackage]
- Step 5 (manual): List in
TEST_MODULES_TO_TRACK_AND_RUN
the test modules to track and runTEST_MODULES_TO_TRACK_AND_RUN = [EmptyPackageUnitTests]
In each test module (e.g. EmptyPackageUnitTests), define a run()
function that calls all your tests.
With this setup, any changes to your source files in the tracked modules will trigger an automatic rerun of the specified test modules, giving you immediate feedback on your changes.
To complete.
To run tests just once without the revise-test loop, run ]test
in the Julia REPL.