-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to print the reports of the nested tests #27088
Comments
I want to discuss something. I could do this with a very simple patch against v0.6 (can't compile v0.7 sysimg for some reason): https://gist.github.com/ronisbr/2b973adc074e5a176b124a6886aee23b With this patch, we can pass a Boolean to using Base.Test
@testset "Test" true begin
@testset "Test 1" begin
@test 1 == 1
@testset "Teste 1.1" begin
@test 1 == 1
end
end
@testset "Test 2" begin
@test 1 == 1
end
@testset "Test 3" begin
@test 1 == 1
end
@testset "Test 4" begin
@test 1 == 1
end
@testset "Test 5" begin
@test 1 == 1
end
@testset "Test 6" begin
@test 1 == 1
end
end Then the result will be:
If the user omit the boolean or choose I need to figure out what to do when the |
With your patch, do you recurse all the way down or does it print only up to depth 1? |
Couldn't this be just be handled by using a custom TestSet? |
If you look to the example in the documentation, you can customize just about anything about the way that your testset is handled; I don't have a strong opinion on whether the default test framework should provide the option you suggest (though it seems reasonable to keep the default test objects as minimal as possible) but AFAIK it's easy enough to define an alternative testset (even in a package) and provide the option you suggest. If I have time later, I may have a try at doing so out of curiosity, since I've only implemented an AbstractTestSet once before |
Probably I am wrong, but I did not find an easy way to do this using a custom test set. The only thing I though was to rewrite a custom # Only print results at lower levels if we had failures
if np + nb != subtotal
for t in ts.results
if isa(t, DefaultTestSet)
print_counts(t, depth + 1, align,
pass_width, fail_width, error_width, broken_width, total_width)
end
end
end However, I thought something different. What if we add an option to |
I was starting to work with this but my last option is now viable. Because |
Hi guys!
I have a package with lots of tests. I am using nested test sets to improve organization, something like:
However, if nothing fails, then nothing about the subtests is printed. This is not good, because I cannot be sure if every test was executed. Is it possible to provide an option to
@testset
print the reports of the subsets all the time?The text was updated successfully, but these errors were encountered: