Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TEST_CASE_CLASS #702

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open

Fix TEST_CASE_CLASS #702

wants to merge 25 commits into from

Conversation

Saalvage
Copy link
Member

@Saalvage Saalvage commented Oct 3, 2022

Fixes #608

TODO:

  • Add docs

DanielKriz and others added 18 commits September 13, 2022 04:36
Name of target is different from the name of executable. Therefore this
example would fail in the generation phase.
CMake's `FindMPI` module sets `MPIEXEC_EXECUTABLE` and `MPIEXEC_NUMPROC_FLAG`. We use them so it works for different MPI implementations.
* Explicitly convert pointer in `filldata<T*>::fill`

* Add regression test

* Increase standard compliance

* Collect test output

* Collect test output

* Fix warnings

* Add GCC workaround

* Update doctest.h

* Move __extension__

* Use different workaround

* Add missing const qualifier

Co-authored-by: Salvage <29021710+Saalvage@users.noreply.github.com>
* Add sanitizer CI

* Fix setup

* Separate sanatizers

* Add integer sanitizers

* Finalize sanitizer list

* Specify libc++

* Remove overly complicated sanitizers

* Readd removed CI

* Suppress hash() clang integer sanitizer issues

* Add changes to parts

* Add version limit

Co-authored-by: Stefan <29021710+Saalvage@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #702 (b280c5c) into dev (96273fd) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev     #702   +/-   ##
=======================================
  Coverage   92.19%   92.19%           
=======================================
  Files           2        2           
  Lines        2127     2127           
=======================================
  Hits         1961     1961           
  Misses        166      166           
Impacted Files Coverage Δ
doctest/parts/doctest_fwd.h 97.70% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Saalvage Saalvage linked an issue Oct 4, 2022 that may be closed by this pull request
@Saalvage Saalvage linked an issue Oct 4, 2022 that may be closed by this pull request
Saalvage and others added 7 commits October 8, 2022 00:55
* Add newer CI versions

* Fix old and new versions

* Add debian repos

* Fix typo

* Try add keys

* Update main.yml

* Revert broken changes

* Whitespace fix
* Fix stringification of enums that overload `operator<<`

* Make operator<< static
* Use include guards (#679)

* Change to ‘Include Guards’ to enhance compatibility

* Update doctest/extensions/mpi_sub_comm.h

Optimising macro names

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

* Update doctest/extensions/mpi_reporter.h

Optimising macro names

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>

* Add vcpkg installation instructions (#695)

* Add vcpkg installation instructions

* Fix typo

Co-authored-by: Salvage <29021710+Saalvage@users.noreply.github.com>

* Fix typo

* Clarify ..._THROWS documentation

Co-authored-by: Yongpeng Zhang <zhangyp6603@outlook.com>
Co-authored-by: Philipp Bucher <philipp.bucher@tum.de>
Co-authored-by: Cheney Wang <38240633+Cheney-W@users.noreply.github.com>
This reverts commit ebda047.
@avoirtech
Copy link

avoirtech commented Oct 18, 2022

Hi @Saalvage - I was trying out this branch (at b280c5c) and it fixes the compile problem for me - thanks.

However, noticed that some of my TEST_CASE_CLASS cases were not being run. With the following two minimal examples in the same .h file, the first runs (failing as expected), the second does not run at all:

class NonTemplated {
    int foo;
public:
    TEST_CASE_CLASS("NonTemplatedRuns") {
        NonTemplated x;
        x.foo = 3;
        CHECK(x.foo == 10);
    }
};


template<typename T>
class Templated {
    T foo;
public:
    TEST_CASE_CLASS("TemplatedDoesNotRun") {
        Templated<int> x;
        x.foo = 3;
        CHECK(x.foo == 10);
    }
};

I'm not sure if this is related to the recent changes, an existing issue, or something I'm doing wrong, but thought I would check here first before raising an issue. Any thoughts?

@Saalvage
Copy link
Member Author

@avoirtech Your template type is not being instantiated anywhere. If you explicitly instantiate the template like so: template class Templated<int>; it works. However, it would run the same test for every instantiation present in your code.. I'm not sure if there's anything to alleviate this..

@avoirtech
Copy link

Thanks @Saalvage, that worked for me, and I've raised an issue here to make others aware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TEST_CASE_CLASS is broken in v2.4.8
8 participants