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

Handle PlayStation platforms #2562

Merged
merged 6 commits into from
Nov 9, 2022

Conversation

objectx
Copy link
Contributor

@objectx objectx commented Nov 8, 2022

Description

This PR tries to resolve the following problems when compiling Catch2 for the Playstation platform.

  1. No POSIX signals
  2. No getenv
  3. No gmtime_r

@@ -89,7 +89,7 @@ namespace Catch {
TestCaseInfo const* rhs ) {
return *lhs < *rhs;
};
std::set<TestCaseInfo const*, decltype(testInfoCmp)> seenTests(testInfoCmp);
std::set<TestCaseInfo const*, decltype(testInfoCmp) &> seenTests(testInfoCmp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the ref here needed?

Copy link
Contributor Author

@objectx objectx Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without &, The std::set in PlayStation SDK's STL tried to invoke a copy-constructor (and failed).

STL Bug?

MSBuild version 17.4.0+18d5aef85 for .NET Framework
  catch_chronometer.cpp
  catch_benchmark_function.cpp
  catch_run_for_at_least.cpp
  catch_stats.cpp
  catch_get_random_seed.cpp
  catch_tag_alias_autoregistrar.cpp
  catch_test_spec.cpp
  catch_timer.cpp
  catch_tostring.cpp
  catch_totals.cpp
  catch_version.cpp
  catch_generator_exception.cpp
  catch_generators.cpp
  catch_generators_random.cpp
  catch_interfaces_capture.cpp
  catch_interfaces_config.cpp
  catch_interfaces_exception.cpp
  catch_interfaces_registry_hub.cpp
  catch_interfaces_reporter_factory.cpp
  catch_interfaces_reporter_registry.cpp
  catch_interfaces_testcase.cpp
  catch_decomposer.cpp
  catch_errno_guard.cpp
  catch_lazy_expr.cpp
  catch_leak_detector.cpp
  catch_message_info.cpp
  catch_polyfills.cpp
  catch_startup_exception_registry.cpp
  catch_test_case_info_hasher.cpp
  catch_test_case_registry_impl.cpp
  In file included from D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:14:
  In file included from D:\dev\Catch2\src\src\catch2\..\catch2/internal/catch_run_context.hpp:11:
  In file included from D:\dev\Catch2\src\src\catch2\..\catch2/interfaces/catch_interfaces_reporter.hpp:22:
  In file included from C:\tools\SCE\Orbis-SDK\10.000\target\include\map:10:
C:\tools\SCE\Orbis-SDK\10.000\target\include\xtree(1058,11): error : no matching constructor for initialization of 'std::_Tree_comp<false, std::_Tset_traits<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28), std::allocator<const Catch::TestCaseInfo *>, false>>::key_compare' (aka '(lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28)') [D:\dev\Catch2\0.B\orbis\src\Catch2.vcxproj]
                  return (key_compare());
                          ^
  C:\tools\SCE\Orbis-SDK\10.000\target\include\xtree(1986,38): note: in instantiation of member function 'std::_Tree_comp<false, std::_Tset_traits<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28), std::allocator<const Catch::TestCaseInfo *>, false>>::_Getcomp' requested here
                                  _Addleft = !_DEBUG_LT_PRED(this->_Getcomp(),
                                                                   ^
  C:\tools\SCE\Orbis-SDK\10.000\target\include\xtree(1403,11): note: in instantiation of function template specialization 'std::_Tree<std::_Tset_traits<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28), std::allocator<const Catch::TestCaseInfo *>, false>>::_Insert_nohint<const std::_Tree<std::_Tset_traits<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28), std::allocator<const Catch::TestCaseInfo *>, false>>::value_type &, std::_Nil>' requested here
                  return (_Insert_nohint(false,
                          ^
  C:\tools\SCE\Orbis-SDK\10.000\target\include\set(226,20): note: in instantiation of member function 'std::_Tree<std::_Tset_traits<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28), std::allocator<const Catch::TestCaseInfo *>, false>>::insert' requested here
                  return (_Mybase::insert(_Val));
                                   ^
  D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp(95,41): note: in instantiation of member function 'std::set<const Catch::TestCaseInfo *, (lambda at D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp:88:28)>::insert' requested here
              const auto prev = seenTests.insert( infoPtr );
                                          ^
  D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp(88,28): note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
          auto testInfoCmp = []( TestCaseInfo const* lhs,
                             ^
  D:\dev\Catch2\src\src\catch2\internal\catch_test_case_registry_impl.cpp(88,28): note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided
  1 error generated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bleh. This is an upstream bug and needs to be reported there.

I am willing to merge to workaround in the meantime though.

docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #2562 (0c81294) into devel (fdea5a5) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            devel    #2562      +/-   ##
==========================================
+ Coverage   91.09%   91.11%   +0.01%     
==========================================
  Files         187      187              
  Lines        7623     7623              
==========================================
+ Hits         6944     6945       +1     
+ Misses        679      678       -1     

@horenmar horenmar merged commit b7f4a2e into catchorg:devel Nov 9, 2022
@objectx objectx deleted the feature/handle-playstation branch November 9, 2022 14:15
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.

2 participants