I hate numbered test files. Not that it isn't useful to force the ordering of some tests, but because its not then necessary to force the ordering of EVERY test. At the worst case you're back to BASIC. Observe the test suite from SQL::Statement.
00error.t 01prepare.t 02executeDirect.t 03executeDBD.t 04names.t 05create.t 06group.t 07case.t 08join.t 09ops.t 10limit.t 11functions.t 12eval.t 13call.t 14allcols.t 15naturaljoins.t 16morejoins.t 17quoting.t 18bigjoin.t 19idents.t 20pod.t 21pod_coverage.t
What I usually recommend people to do, particularly if the test suite gets large, is to name tests after their packages. For SQL::Statement, you would get something like this:
t/sql/dialects/ansi.t
t/sql/dialects/anydata.t
t/sql/dialects/csv.t
t/sql/eva l.t
t/sql/parser.t
t/sql/statement.t
t/sql/statement/function.t
t/sql/statem ent/functions.t
t/sql/statement/getinfo.t
t/sql/statement/operation.t
t/sql/s tatement/placeholder.t
t/sql/statement/ram.t
t/sql/statement/term.t
t/sql/sta tement/termfactory.t
t/sql/statement/util.t
If you want something more detailed because your packages are too large you can break down those final
t/sql/statement/function-equal.t
t/sql/statement/function-noequal.t
t/sql/stat ement/function-lower.t
By switching to this system, it makes it ridiculously easy to figure out where every test goes (not true for many large test suites) and it also makes it easy to write editor tools to jump between tests and packages.
And cross-post this to blogs.perl.org! It's gotten to be fairly stable and more people are switching
Realistically most test dependencies really want to express two things: Run this first and run this last. For that you have 00foo.t and 99bar.t. 00compile.t, 00setup.t, 99teardown.t, 99pod.t, etc... Anything else, just write it without the number.
Wouldn't that make a test file starting with an alphabetic character run after the 99
-prefixed files?
Re:Er.
schwern on 2009-12-29T13:35:13
Oh yeah, I knew there was a reason I was using zz as a prefix.
I don't necessarily use consecutive numbers, instead, I use three-digit numbers, with the first digit indicating a "category".
This is from one distribution of mine.
001_compile.t
100_machine.t
102_misc.t
103_wix_component.t
104_wix_fragment.t
111_environment.t
112_files_entry.t
113_files_component.t
114_files_directoryref.t
115_startmenu.t
116_registry.t
117_directorytree.t
118_icons.t
119_createfolder.t
120_feature.t
121_files.t
122_removefolder.t
500_new.t
800_perlcritic.t
801_pod.t
802_pod_coverage.t
803_minimumversion.t
804_manifest.t
805_meta.t
806_portability.t
807_version.t
899_prereq.t
901_perl_589.t
902_perl_5100.t
903_perl_5101.t
904_portable.t
In this case, the 0xx tests are for compilation only, the 1xx tests do small portions of the distribution, the 5xx is an "overall" test, 8xx are author tests, and 9xx are long-running (we're talking hours) release tests that are guarded with an environment variable.
To each his own, however.
Re:I group the numbers...
schwern on 2010-01-09T21:10:15
This is why God invented directories.