catchorg / Catch2

A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
https://discord.gg/4CWS9zD
Boost Software License 1.0
18.67k stars 3.05k forks source link

DISABLED_TEST_CASE #1187

Open gelldur opened 6 years ago

gelldur commented 6 years ago

Description

It would be nice to have solution build in for diabling tests. Not hiding them because when you hide only and pass eg. to not run [~long] tests cases then hidden will be executed.

Extra information

Sample implementation

#pragma once

#define CONCAT_(x, y) x##y
#define CONCAT(x, y) CONCAT_(x,y)

#define DISABLED_TEST_CASE(...)  __attribute__ ((unused)) static void CONCAT(disabled_test_,__LINE__)()
philsquared commented 6 years ago

We're considering a change to how hidden tests interact with filters. (see https://github.com/catchorg/Catch2/issues/1184#issuecomment-365300867)