Sometimes I run unit tests on ClarionMagLibrary (CML) code, and sometimes on non-CML code. When I run the latter I may or may not want to include the CML library, but when I run the former I usually want to compile the code directly so I don't have to remember whether I'm testing a library change or a unit test change. It's also usually an advantage to test against a local compile until I'm sure everything is working - that way I'm not breaking any code that does use the library.
I got tired of setting the necessary project define in my project, so I added a couple of lines to the global extension template. Line 3 is a new prompt, which has a related #Enable/#EndEnable section that wraps the original "Include the ClarionMag library" prompt.
#EXTENSION(TestSupportIncludes,'Add global includes for test support'),APPLICATION,DESCRIPTION('[ClarionTest] Global Includes for Test Support') #DISPLAY #Prompt('Compile ClarionMag Library source',Check),%CompileClarionMagLibrarySource,At(10,,180) #Enable(%CompileClarionMagLibrarySource=%false) #Prompt('Include the ClarionMag library',check),%IncludeClarionMagLib,default(%true),At(10,,180) #EndEnable #PROMPT('Generate help comments',CHECK),%ShowHelpComments,Default(%False),At(10,,180) #DISPLAY('You can add the name of your Class .INC files below. The INCLUDE directive will be added for you.'),AT(10,,180,24) #BOXED('Class .INC Files') #PROMPT('Class .INC File:',@S200),%TestClasses,MULTI('Class .INC File') #ENDBOXED #!********** #ATSTART #IF(VAREXISTS(%TestGroups) AND ITEMS(%TestGroups) = 0) #ADD(%TestGroups,'Default') #ENDIF #If(%CompileClarionMagLibrarySource) #Set(%IncludeClarionMagLib,%False) #PDefine('_Compile_CML_Class_Source_',1) #Else #PDefine('_Compile_CML_Class_Source_',0) #EndIf #ENDAT #AT(%CustomGlobalDeclarations),where(%IncludeClarionMagLib) #PROJECT('CMagLib.lib') #ENDAT