Skip to main content

SCons tool to compile and run tests based on CxxTest framework

Project description

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

SCons tool to compile and run unit tests based on cxxtest framework.

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 cxxtest tool from pypi, type (within your wirtualenv):

pip install scons-tool-loader scons-tool-cxxtest

or, if your project uses pipenv:

pipenv install --dev scons-tool-loader scons-tool-cxxtest

Alternatively, you may add this to your Pipfile

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

The tool will be installed as a namespaced package sconstool.cxxtest 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-cxxtest as a submodule:

    git submodule add git://github.com/ptomulik/scons-tool-cxxtest.git site_scons/site_tools/cxxtest
  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.cxxtest (this may be required by other tools).

Usage example

  1. Create simple test file

    // MyTestSuite.t.h
    #include <cxxtest/TestSuite.h>
    class MyTestSuite : 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 = ['default', 'cxxtest'])
    env.CxxTest('MyTestSuite')
  3. Try it out:

    scons

Builders

  • CxxTestObject([target], source, **kw),

  • CxxTestProgram([target], source, **kw),

  • CxxTest([target], source, [root], **kw).

Construction variables used

The following SCons construction variables might be used to customize the cxxtest tool. In addition to these, a $CXXTESTGENSUFFIX is used as the source suffix for CxxTestObject builder, see scons-tool-cxxtestgen.

Name

Description

Default Value

CXXTESTCCFLAGS

Options for C and C++ compilers.

"$CCFLAGS"

CXXTESTCPPDEFINES

C preprocessor definitions.

"$CPPDEFINES"

CXXTESTCPPFLAGS

C preprocessor options.

"$CPPFLAGS"

CXXTESTCPPPATH

List of C/C++ include directories.

["$CXXTESTINCLUDEPATH", "$CPPPATH"]

CXXTESTCXX

The C++ compiler.

"$CXX"

CXXTESTCXXFLAGS

Options for C++ compiler.

"$CXXFLAGS"

CXXTESTINCLUDEPATH

Extra include path to be prepended to CPPPATH.

Determined automatically.

CXXTESTLIBPATH

List of directories to be searched for libraries.

"$LIBPATH"

CXXTESTLIBPREFIX

The prefix used for (static) library names.

"$LIBPREFIX"

CXXTESTLIBS

A list of libraries to be linked with executable.

"$LIBS"

CXXTESTLIBSUFFIX

The suffix used for (static) library names.

"$LIBSUFFIX"

CXXTESTLINK

The linker.

"$LINK"

CXXTESTLINKFLAGS

General user options passed to the linker.

"$LINKFLAGS"

CXXTESTOBJPREFIX

The prefix used for (static) object file names.

"$OBJPREFIX"

CXXTESTOBJSUFFIX

The suffix used for (static) object file names.

"$OBJSUFFIX"

CXXTESTPROGPREFIX

The prefix used for executable file names.

"$PROGPREFIX"

CXXTESTPROGSUFFIX

The suffix used for executable file names.

"$PROGSUFFIX"

CXXTESTRUNFLAGS

Options for test runner.

[]

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-cxxtest-0.2.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

scons_tool_cxxtest-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file scons-tool-cxxtest-0.2.1.tar.gz.

File metadata

  • Download URL: scons-tool-cxxtest-0.2.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for scons-tool-cxxtest-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e0f19c2fc89669f35ba2850d12e2597ddf3f3fb37af2af17c078ca88f7f27359
MD5 b72e20f9f15b131e2c0774e9de104843
BLAKE2b-256 31b89e39b6daac6905b802da721c726e2abd344e9eea5edc450b426183073854

See more details on using hashes here.

File details

Details for the file scons_tool_cxxtest-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: scons_tool_cxxtest-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for scons_tool_cxxtest-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b71efe24b56f269fd0deb49314de711442c4fe436155c6f7db9151c3df264d0a
MD5 2ac89a5199526d2508ffb67bc51a8a2f
BLAKE2b-256 898b50c8859e28d50fa1ab05ca45b22cfe6a31f24a798c08a4f183c9daefdbbb

See more details on using hashes here.

Supported by

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