crpcut icon

crpcut For Linux

  n/a
BSD License    

The Compartmented Robust Posix C++ Unit Tester. #Unit tester  #Unit-test framework  #C++  #Unit  #Tester  #Framework  

Description

changelog

Free Download

crpcut (pronounced "crap cut") is the Compartmented Robust Posix C++ Unit Tester. With crpcut it's easy to write tests that other unit-test frameworks cannot manage.

An example testing parts of std::string:

 #include < crpcut.hpp >  #include < string >

struct apastr // fixture for mosts tests  {  apastr() : s("apa") {}  std::string s;  };

TESTSUITE(basics)  {  TEST(default_constr_and_destr)  {  std::string s;  ASSERT_TRUE(s.empty());  ASSERT_EQ(s.length(), 0);  }  TEST(constr_from_char_array, apastr,  DEPENDS_ON(default_constr_and_destr))  {  ASSERT_EQ(s.length(), 3UL);  }  TEST(at, apastr,  DEPENDS_ON(default_constr_and_destr))  {  ASSERT_EQ(s.at(1), 'p');  }  }

TESTSUITE(errors, DEPENDS_ON(ALL_TESTS(basics)))  {  TEST(at_out_of_range, apastr,  EXPECT_EXCEPTION(std::out_of_range))  {  s.at(4);  }  TEST(index_oper_out_of_range, apastr,  EXPECT_SIGNAL_DEATH(SIGABRT),  NO_CORE_FILE)  {  s[4];  }  }

int main(int argc, char *argv[])  {  return crpcut::test_case_factory::run_test(argc, argv);  }

Similar tests benefits from being grouped into test-suites. Test-suites can depend on other test-suites, meaning that the contained tests will only run if all tests it depends on have completed successfully. Results can be validated using a number of ASSERT macros. Tests can use fixtures to express common contents. Tests can be expected to exit by exception, or die. Expectations that are not met are errors. Messages on stderr and stdout are gaught, and included in the result log.

Most importantly, it must be easy to write tests. With crpcut, you focus on your test structure and test logic, not on the limits imposed by your test environment.

With crpcut, every test case runs in its own process and its own working directory. If a test case fails, the process terminates immediately, before it does further harm. This means that every test case starts from a clean slate, unaffected by other tests. This is the compartmentalization.

It also means that the test suite continues, even if a test crashes. You can set deadlines for test cases, and if the allowed time is seriously overdrawn, the test case process is killed. These two make up the robustness part.

You can define dependencies between test cases and between test suites, so that if a fundamental tests fails, the tests that are based on the fundamental functionality will not even be run.

The crpcut main process does not have any dynamic memory allocated at the time a test case process is started, so you can run crpcut using a memory test tool, such as valgrind, and if there is memory allocated when the test case process terminates, you can be assured that you have found a memory leak in your test.

If you have a multi-core CPU, it may be beneficial to run several test cases in parallel. crpcut allows that.

If there are files left in the test process' working directory after the test case process has terminated, the test case is considered failed. The working directory is left untouched by crpcut, for you to examine.

What's new in crpcut 1.9.2:

  • This version supports distributions with old versions of CMake.
Read the full changelog

crpcut 1.9.2

add to watchlist add to download basket send us an update REPORT
  runs on:
Linux
  1 screenshot:
crpcut - screenshot #1
  main category:
Programming
  developer:
  visit homepage

Zoom Client 6.0.3.37634

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

Windows Sandbox Launcher 1.0.0

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

Context Menu Manager 3.3.3.1

Customize Windows’ original right-click context menu using this free, portable and open-source utility meant to enhance your workflow
Context Menu Manager

4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

Bitdefender Antivirus Free 27.0.35.146

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

ShareX 16.0.1

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

7-Zip 23.01 / 24.04 Beta

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

calibre 7.9.0

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

IrfanView 4.67

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

% discount
Microsoft Teams
  • Microsoft Teams
  • calibre
  • IrfanView
  • Zoom Client
  • Windows Sandbox Launcher
  • Context Menu Manager
  • 4k Video Downloader
  • Bitdefender Antivirus Free
  • ShareX
  • 7-Zip
essentials


Click to load comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy