-
Notifications
You must be signed in to change notification settings - Fork 482
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
Use at-testset for tests #294
Conversation
Thanks for doing this! I'll take a closer look once I've gotten the LaTeX stuff out of the way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. The indentation for inner modules is definitely a good idea, would be good to add a line to the style guide page mentioning it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, it became quite a few commits. However, due to the nature of changes, i.e. copy-pasting blocks of code, I think it is a good idea to keep them as separate as possible.
I tried to avoid making any changes to the tests themselves. The few things I had to change I pointed out in the comments (and hopefully didn't forget any).
@@ -21,6 +21,7 @@ Follow the style of the surrounding text when making changes. When adding new fe | |||
### Julia | |||
|
|||
* 4-space indentation; | |||
* modules spanning entire files should not be indented, but modules that have surrounding code should; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note here about the modules. Thoughts on the phrasing very welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wording sounds good to me.
|
||
import Documenter: Documenter, DocSystem | ||
|
||
const alias_of_getdocs = DocSystem.getdocs # NOTE: won't get docstrings if in a @testset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to move this here, since the test on line 66 started failing (d_4
had 0 docstrings).
info("Building Documenter's docs with LaTeX.") | ||
const Documenter_root = normpath(joinpath(dirname(@__FILE__), "..", "..", "docs")) | ||
doc = makedocs( | ||
debug = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a debug flag here.
a = Documenter.Utilities.filterdocs(doc, Set{Module}()) | ||
b = Documenter.Utilities.filterdocs(doc, Set{Module}([UnitTests])) | ||
c = Documenter.Utilities.filterdocs(doc, Set{Module}([Base])) | ||
d = Documenter.Utilities.filterdocs(doc, Set{Module}([UtilitiesTests])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to change the module name here.
Appveyor failures due to path handling, I'll have to fix those. I was wondering why we have the Best practice wise though -- should we construct all paths with It is nice to see the testsets in action though:
|
I'd say just always use
Awesome! |
Move the code of setting up the modules and building the examples docs under examples/ to test/examples/make.jl. This allows the examples/ to be built without calling the whole runtests.jl file. The pages/* are considered to be part of the examples/. The Mod and AutoDocs modules are now indented to help with readability. Also, the output from the examples/ builds will now be stored under test/examples/builds/<format>, instead of test/examples/build-<format>.
Moves the tests of the examples/ build to examples/tests.jl. The tests can be run separately as well.
Also properly indent the test code and add some logic to check if make.jl has been loaded properly.
And otherwise reorganize the file a bit. Fixes #154.
I fixed the paths in However, I do feel that for
I also took the liberty of dropping branch restrictions from |
Yeah, paths in |
Julia already handles cross-platform matters and always includes files relative to the current file, so they're not necessary and dropping them makes the code more readable.
Thanks for reviewing! I removed the few remaining |
Thanks for sorting this one out @mortenpi! |
A pretty big bunch of changes attempting to organize tests in a more readable manner. Addresses #154. I see that #288 doesn't have any tests yet, so I'm hopefully not conflicting with it. Motivation comes from #282 -- I wanted to make a few small changes to
examples/
for it.A summary of the changes:
@testset
.examples/
separately (useful for testing changes to HTML writer etc.).@testset
macro, so we need to define modules/types outside it. Hencenavnode.jl
depends onfaketypes.jl
andexamples/tests.jl
(and due to aninclude
,runtests.jl
) depends onexamples/make.jl
.pages/
to be part of theexamples/
(but also use them + the modulesMod
andAutoDocs
, defined now inexamples/make.jl
, inruntests.jl
for unit tests).Things are quite interlinked here and so this ended up being this one big commit at the moment. I am considering splitting it up into several commits to make it easier to review (most importantly to make sure that we're not losing or making useless any of the existing tests). However a discussion on what the final result should look like would be useful before I get to that.
TODO:
TODO
s).