Skip to main content
PyPi package version Travis CI build status https://ci.appveyor.com/api/projects/status/github/ptomulik/scons-tool-cxxtestgen?svg=true

SCons tool for cxxtestgen command.

Installation

There are few ways to install this tool for your project.

From pypi

This method may be preferable if you build your project under a virtualenv. To add cxxtestgen tool from pypi, type (within your wirtualenv):

pip install scons-tool-loader scons-tool-cxxtestgen

or, if your project uses pipenv:

pipenv install --dev scons-tool-loader scons-tool-cxxtestgen

Alternatively, you may add this to your Pipfile

[dev-packages]
scons-tool-loader = "*"
scons-tool-cxxtestgen = "*"

The tool will be installed as a namespaced package sconstool.cxxtestgen in project’s virtual environment. You may further use scons-tool-loader to load the tool.

As a git submodule

  1. Create new git repository:

    mkdir /tmp/prj && cd /tmp/prj
    touch README.rst
    git init
  2. Add the scons-tool-cxxtestgen as a submodule:

    git submodule add git://github.com/ptomulik/scons-tool-cxxtestgen.git site_scons/site_tools/cxxtestgen
  3. For python 2.x, create __init__.py in site_tools directory:

    touch site_scons/site_tools/__init__.py

    this will allow to directly import site_tools.cxxtestgen (this may be required by other tools).

Usage example

  1. Create simple test file

    // MyTestSuite1.t.h
    #include <cxxtest/TestSuite.h>
    class MyTestSuite1 : public CxxTest::TestSuite
    {
    public:
      void testAddition(void)
      {
        TS_ASSERT(1 + 1 > 1);
        TS_ASSERT_EQUALS(1 + 1, 2);
      }
    };
  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')
  3. Try it out:

    scons

Builders

  • CxxTestGen([target], sources, **kw) - invokes cxxtestgetn ....

  • CxxTestGenPart([target], sources, **kw) - invokes cxxtestgen --part ..., this is used to generate *.t.cpp files which define tests but have no main().

  • CxxTestGenRoot(target, **kw) - invokes cxxtestgen --root ..., this pseudo-builder generates the root *.t.cpp file that provides the main() function, should be used in pair with CxxTestGenPart.

Construction variables used

The following SCons construction variables might be used to customize the cxxtestgen tool.

Name

Description

CXXTESTBINPATH

search path for cxxtest executables/scripts; by default it includes the following locations:

  • $CXXTESTINSTALLDIR/bin,

  • $CXXTESTINSTALLDIR/python/python3/scripts,

  • $CXXTESTINSTALLDIR/python/scripts,

in that order.

CXXTESTGEN

path to cxxtestgen python script; by default it will contain a result of search, first in $CXXTESTBINPATH, then in SCons PATH.

CXXTESTGENFLAGS

additional flags to be passed to cxxtestgen.

CXXTESTGENPYTHON

python 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.

CXXTESTGENRUNNER

name of the listener class for cxxtestgen (used as --runner=$CXXTESTGENRUNNER); defaults to ErrorPrinter.

CXXTESTGENSUFFIX

suffix for files produced by cxxtestgen (.t.cpp).

CXXTESTGENSRCSUFFIX

suffix of cxxtestgen’s input files (.t.h).

CXXTESTINSTALLDIR

root directory of custom cxxtest installation; defaults to #/cxxtest, where # is the project’s top-level directory.

LICENSE

Copyright (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

Metadata

Release files for scons-tool-cxxtestgen 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scons-tool-cxxtestgen 0.2.0
File Size Uploaded
scons-tool-cxxtestgen-0.2.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scons-tool-cxxtestgen 0.2.0
File Interpreter ABI Platform
scons_tool_cxxtestgen-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / scons-tool-cxxtestgen-0.2.0.tar.gz

Download URL scons-tool-cxxtestgen-0.2.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e06775e8b2d3f8aae81c8143c401bacd408db3378ac38dab288b4bd0697be21d
BLAKE2b-256 checksum
How to use checksums
c460a29f7a02fd1ef506a040d3ed65f3846dba799ceac36f290e30e913fed74f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release files / scons_tool_cxxtestgen-0.2.0-py3-none-any.whl

Download URL scons_tool_cxxtestgen-0.2.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e935b02d0c844e85ca7cd44d55d9848ad4d37462546447086b8f3220b8cf4589
BLAKE2b-256 checksum
How to use checksums
3cbfe2e34b1d9865fe5f1b320e676c85f8fba7a3ea87f5dc88ddc09764bf2aa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page