Skip to main content

SCons tool for cxxtestgen command

Project description

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

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

Construction variables used

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

Name

Description

CXXTESTGEN

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

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.

CXXTESTINSTALLDIR

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

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.

CXXTESTGENFLAGS

additional flags to be passed to cxxtestgen.

CXXTESTGENSUFFIX

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

CXXTESTGENSRCSUFFIX

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

LICENSE

Copyright (c) 2018 by Pawel 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scons-tool-cxxtestgen-0.1.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

scons_tool_cxxtestgen-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file scons-tool-cxxtestgen-0.1.1.tar.gz.

File metadata

  • Download URL: scons-tool-cxxtestgen-0.1.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for scons-tool-cxxtestgen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 65373bc252d4b4cb430e676103995ad0402ace38ee42d8b0cbb36a3af8c9cfa9
MD5 53d4d166d8391d2ba35388db781b0b0b
BLAKE2b-256 d3d3d93eba39cef5cd3fe33c77a5c562d2b3ae116b5c14000ae0923dcf2a8b8e

See more details on using hashes here.

File details

Details for the file scons_tool_cxxtestgen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scons_tool_cxxtestgen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for scons_tool_cxxtestgen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eecaff5756084ec2602159cf4048a2987096ac3f9a545500d8e9a4937ed7493b
MD5 1d5a8331c96cb39d0d2fef53ecdfd275
BLAKE2b-256 256aa43dbc6f7363b1d4db7669839fb2b9fd58b7af80f33f571a40b2544ebd0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page