JunoLab / Traceur.jl

Other
318 stars 15 forks source link

Testing functionality #6

Closed GunnarFarneback closed 5 years ago

GunnarFarneback commented 6 years ago

When you have fixed everything Traceur found to complain about, you want it to stay that way, and you want to have automated tests monitoring it.

I'd love to be able to do something like

@tracetest :no_dynamic_dispatch :no_type_instability run_my_testcase()

or maybe

report = @tracereport run_my_testcase()
@test no_dynamic_dispatch(report)
@test number_allocations(report) <= 1
@test allocated_bytes(report) <= 20000
MikeInnes commented 6 years ago

Yeah, this'd be good to have. Check out the tests that Traceur itself runs; I think it'd be pretty easy to build on that to create these macros.

DilumAluthge commented 5 years ago

@GunnarFarneback Now that https://github.com/JunoLab/Traceur.jl/pull/32 has been merged, does that meet your needs?

With https://github.com/JunoLab/Traceur.jl/pull/32, you can now do something like this:

using Traceur
@check run_my_testcase() nowarn=:all

This will throw an error (thus causing your test suite to fail) if Traceur finds any issues inside run_my_testcase().

If Traceur does not find any issues, it will not throw an error, and thus your test suite will pass.

DilumAluthge commented 5 years ago

@pfitzseb Do you think that this issue can be closed now?