pas2ut(1)
π pas2ut β the Free Pascal unit-to-unit-test-case conversion tool β¨
okay bestie, gather round, because this little icon of a manual page is pas2ut(1) and it is literally about to save you so much boring typing π«Ά
πΈ NAME πΈ
pas2ut β the Free Pascal unit to unit test case conversion tool. that's it, that's the whole vibe. it takes a unit and β¨convertsβ¨ it into tests. no cap.
π SYNOPSIS π
pas2ut [options] inputfile [outputfile]
π¦ DESCRIPTION π¦
so here's the tea: pas2ut goes through your input file, hunts down all the classes and routines it can find, and then β slay β it builds a testcase for every single class and routine hanging out in the interface section of that file. π
it can spit out either a unit or an include file, dealer's choice. every test it creates comes with a standard fail message, so nothing's ever silently passing on you (we love accountability π).
and by default? it's only generating tests for the public, published and default visibility members of your classes. very "we respect your privacy" of it, honestly.
π USAGE π
pas2ut is taking these options at this moment in time, bestie:
--defaultclasstest=listβ give it a comma-separated list of default tests, one set for each class. heads up: every element in that list has to be a valid pascal identifier, or it's not gonna fly. β--failmessage=Msgβ sets the message that goes inside theFail()statement in every single test method. your custom little "girl, this broke" note. π--limit=listβ hand it a comma-separated list of global identifiers and it'll only generate tests for those. default behaviour is everything β all the global identifiers in the interface section of a unit. no filter, all gas.--prefix=nameβ sets the prefix for your test names (the default isTestβ yes with a space, icon behaviour). a test gets named after the identifier it tests, with this prefix slapped on the front. β¨--singletestclassβ one single test class for every class it finds. the default is the opposite: a testcase class per class in the input unit. pick your fighter. π₯--skip-classesβ no test code for classes at all, only functions and procedures. classes said "not today". π--skip-declarationβ skips generating the declarations for the tests, only implementations get made. π--skip-defaultβ skips tests for default visibility members. normally those get generated right alongside the Public or published members, so this is you saying "actually no".--skip-failβ nofail()statements inside the test routine implementations. they just vibe. π§--skip-fieldsβ no testcases for class fields, only methods and properties. fields are on their own journey now.--skip-functionsβ no tests for functions/procedures, only classes. functions, you're benched. πͺ--skip-implementationβ skips generating the (empty) implementation for the tests; you only get a class declaration. it can be completed later in an IDE such as Lazarus or MSIDE, so it's giving "finish it yourself, bestie". π--skip-methodsβ no tests for class methods, only fields and properties.--skip-propertiesβ no tests for class properties, only fields and methods.--skip-property-defaultβ no default test for each property. sorry to the defaults.--skip-publicβ skips tests for public members. only protected members will be tested, and only if--test-protectedis in effect. π--skip-publishedβ no tests for published members; only public and default members get tested. published, you're uninvited from the group chat.--skip-registerβ noRegisterTestsstatement. don't register, it's fine, we're keeping it lowkey.--skip-setupβ doesn't override theTTestCase.Setup()method in the generated class. π οΈ--skip-teardownβ doesn't override theTTestCase.TearDown()method in the generated class. π§Ή--skip-unitβ don't generate a unit, just an include file. simple as.--testparentname=nameβ sets the name of the parent class for the generated test classes. the default isTTestCase, but you can point it at another class name if that's your truth. π--test-property-boundsβ generates aGetBoundstest for each property. bounds check era. π--test-property-maxlenβ generates aMaxLentest for each property. how long is too long? we find out. π--test-property-notifyβ generates aNotifytest for each property. π--test-property-requiredβ generates aRequiredtest for each property. mandatory behaviour only. β--test-protectedβ also generates tests for protected class members. remember, by default tests only get generated for public, published and default visibility members, so this is you going deeper. π΅οΈ--testunitname=nameβ sets the name of the generated unit. if you don't set it, the default gets taken from the output file name. π--tiopfβ creates tiopf tests. this is literally the same as specifying--default,--bounds,--required,--notifyand--maxlentests all at once. one flag, five jobs, main character energy. π₯--unittestclassname=nameβ sets the global unit test class name. to be used with--singletestclass, bestie. they're a package deal. π«Ά
also, quick note:--limitand--defaultclasstestmay be specified multiple times. spam them as much as your heart desires. π
π SEE ALSO π
and that's the whole page, bestie. take care of your units and they'll take care of you. mwah. π
this was Free Pascal, dated 5 sep 2015 β and yes, that's the whole sign-off, no cap. π¦β¨
π¦ where this page comes from
- debian bookworm: fp-utils-3.2.2 3.2.2+dfsg-20 Β· GPL-2.0-or-later
- debian trixie: fp-utils-3.2.2 3.2.2+dfsg-46 Β· GPL-2.0-or-later
- ubuntu jammy: fp-utils-3.2.2 3.2.2+dfsg-9ubuntu1 Β· GPL-2.0-or-later
- ubuntu noble: fp-utils-3.2.2 3.2.2+dfsg-32 Β· GPL-2.0-or-later
- ubuntu questing: fp-utils-3.2.2 3.2.2+dfsg-46
- ubuntu resolute: fp-utils-3.2.2 3.2.2+dfsg-49 Β· GPL-2.0-or-later
- ubuntu stonking: fp-utils-3.2.2 3.2.2+dfsg-51 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms