Skip to main content

eTDD framework

Project description

eTDD

Framework for Test-driven development (TDD) to support to isolate the unit code in C/C++.

Installing

Windows

Before to execute the test, you need to execute the option "Install CppUTest on ./tmp" in the tdd.menu(). It will download and compile the cpputest code.

You need to install also:

Linux

sudo apt install cmake libcpputest-dev cppcheck
sudo apt install doxygen graphviz

Example 1 - simplest example

from etdd import TDD

tdd = TDD()
tdd.download_from_git("https://github.com/neubertm/TDD_framework.git")

# Set the flags in the CMakelists
tdd.cmake["CMAKE_C_FLAGS"] = "-g -O0 -coverage -lgcov "
tdd.cmake["CMAKE_CXX_FLAGS"] = "-g -O0 -coverage -lgcov "

# Test 1 - BitInverter
test = tdd.test("TDD_framework/TESTs/BitInverter_Tpkg/src/test.cpp", "BitInverter")
test.files = ["TDD_framework/project/BitInverter/BitInverter.*", "TDD_framework/TESTs/BitInverter_Tpkg/src/MemLeakDetection*.h"]
test.compile = ["BitInverter.c"]

# Open the menu in the console
tdd.menu()

Example 2 - with environment file

You can create the file tdd.py and execute it with the follow code:

from etdd import TDD, full_main

tdd = TDD(main=full_main, envpath="envpath.ini")
tdd.download_from_git("https://github.com/neubertm/TDD_framework.git")

# Test 1 - BitInverter
test = tdd.test("TDD_framework/TESTs/BitInverter_Tpkg/src/test.cpp", "BitInverter")
test.files = ["TDD_framework/project/BitInverter/BitInverter.*", "TDD_framework/TESTs/BitInverter_Tpkg/src/MemLeakDetection*.h"]
test.compile = ["BitInverter.c"]

# Open the menu in the console
tdd.menu()

envpath.ini

[CMAKE]
check=true
ENV_CONFIG_SCRIPT = /usr/bin/

[MINGW]
check=False
ENV_CONFIG_SCRIPT = /usr/bin/

[MSVC]
check=False
ENV_CONFIG_SCRIPT = /usr/bin/

[CLANG]
check=False
ENV_CONFIG_SCRIPT = /usr/bin/

[CPPCHECK]
check=False
ENV_CONFIG_SCRIPT = /usr/bin/

[CPPUMOCKGEN]
ENV_CONFIG_SCRIPT = /usr/bin/

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

etdd-0.0.10.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file etdd-0.0.10.tar.gz.

File metadata

  • Download URL: etdd-0.0.10.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for etdd-0.0.10.tar.gz
Algorithm Hash digest
SHA256 f269be95f723cb40f2bf31d473a1fb9991462b12181961c5e1783ec0b6e51899
MD5 778eaa063fb9683ed619216c52928d14
BLAKE2b-256 e930d58c3f2dd0152787a89f980a4119a7025de7c2977233242a9a6e0fd49a0c

See more details on using hashes here.

Supported by

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