Package: scons-tool-cxxtestgen
SConstool forcxxtestgencommand.InstallationThere are few ways to install this tool for your project.FrompypiThis method may be preferable if you build your project under a virtualenv. To
add cxxtestgen tool frompypi, type (within your wirtualenv):pipinstallscons-tool-loaderscons-tool-cxxtestgenor, if your project usespipenv:pipenvinstall--devscons-tool-loaderscons-tool-cxxtestgenAlternatively, you may add this to yourPipfile[dev-packages]
scons-tool-loader = "*"
scons-tool-cxxtestgen = "*"The tool will be installed as a namespaced packagesconstool.cxxtestgenin project’s virtual environment. You may further usescons-tool-loaderto load the tool.As a git submoduleCreate new git repository:mkdir/tmp/prj&&cd/tmp/prjtouchREADME.rstgitinitAdd thescons-tool-cxxtestgenas a submodule:gitsubmoduleaddgit://github.com/ptomulik/scons-tool-cxxtestgen.gitsite_scons/site_tools/cxxtestgenFor python 2.x, create__init__.pyinsite_toolsdirectory:touchsite_scons/site_tools/__init__.pythis will allow to directly importsite_tools.cxxtestgen(this may be
required by other tools).Usage exampleCreate simple test file// MyTestSuite1.t.h#include<cxxtest/TestSuite.h>classMyTestSuite1:publicCxxTest::TestSuite{public:voidtestAddition(void){TS_ASSERT(1+1>1);TS_ASSERT_EQUALS(1+1,2);}};Create simple SConstruct file# SConstruct# TODO: uncomment following lines if the tool is installed via pip/pipenv# import sconstool.loader# sconstool.loader.extend_toolpath(transparent=True)env=Environment(tools=['cxxtestgen'])env.CxxTestGen('MyTestSuite')Try it out:sconsBuildersCxxTestGen([target],sources, **kw)- invokescxxtestgetn ....CxxTestGenPart([target],sources, **kw)- invokescxxtestgen--part...,
this is used to generate*.t.cppfiles which define tests but have nomain().CxxTestGenRoot(target, **kw)- invokescxxtestgen--root..., this
pseudo-builder generates the root*.t.cppfile that provides themain()function, should be used in pair withCxxTestGenPart.Construction variables usedThe following SCons construction variables might be used to customize thecxxtestgentool.NameDescriptionCXXTESTBINPATHsearch path for cxxtest executables/scripts; by
default it includes the following locations:$CXXTESTINSTALLDIR/bin,$CXXTESTINSTALLDIR/python/python3/scripts,$CXXTESTINSTALLDIR/python/scripts,in that order.CXXTESTGENpath to cxxtestgen python script; by default it
will contain a result of search, first in$CXXTESTBINPATH, then in SConsPATH.CXXTESTGENFLAGSadditional flags to be passed to cxxtestgen.CXXTESTGENPYTHONpython interpreter to be used to run cxxtestgen;
by default it is being chosen automatically;
python3 is preferred, but if the cxxtestgen seems
to not support it, python2 is picked up; if
neither python3 nor python2 are available in
standard SCons search PATH,sys.executable(the interpreter running SCons script) is used.CXXTESTGENRUNNERname of the listener class for cxxtestgen (used
as--runner=$CXXTESTGENRUNNER); defaults toErrorPrinter.CXXTESTGENSUFFIXsuffix for files produced by cxxtestgen (.t.cpp).CXXTESTGENSRCSUFFIXsuffix of cxxtestgen’s input files (.t.h).CXXTESTINSTALLDIRroot directory of custom cxxtest installation;
defaults to#/cxxtest, where#is the
project’s top-level directory.LICENSECopyright (c) 2018-2020 by Paweł Tomulik <ptomulik@meil.pw.edu.pl>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE