Skip to content

Commit

Permalink
preprocessor trickery
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Mar 29, 2024
1 parent 57b9c9e commit 5da3c4e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions base/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,15 @@ inline void noreturn() { std::exit(0); }
// We assume that the processor is at least a Prescott since we only support
// 64-bit architectures.
#define PRINCIPIA_USE_SSE3_INTRINSICS() !_DEBUG
#ifndef PRINCIPIA_USE_FMA_IF_AVAILABLE
#define PRINCIPIA_USE_FMA_IF_AVAILABLE() !_DEBUG
#endif

#ifndef PRINCIPIA_CONFIGURABLE_TEST_SUFFIX
#define PRINCIPIA_CONFIGURABLE_TEST_SUFFIX
#endif
#define PRINCIPIA_CONFIGURABLE_TEST_NAME(Fixture) \
Fixture##PRINCIPIA_CONFIGURABLE_TEST_SUFFIX

// Set this to 1 to test analytical series based on piecewise Poisson series.
#define PRINCIPIA_CONTINUOUS_TRAJECTORY_SUPPORTS_PIECEWISE_POISSON_SERIES 0
Expand Down
1 change: 1 addition & 0 deletions ksp_plugin_test/ksp_plugin_test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<ClCompile Include="pile_up_test.cpp" />
<ClCompile Include="planetarium_test.cpp" />
<ClCompile Include="plugin_compatibility_test.cpp" />
<ClCompile Include="plugin_compatibility_test_no_fma.cpp" />
<ClCompile Include="plugin_integration_test.cpp" />
<ClCompile Include="plugin_io.cpp" />
<ClCompile Include="plugin_test.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions ksp_plugin_test/ksp_plugin_test.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
<ClCompile Include="..\ksp_plugin\interface_collision.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="plugin_compatibility_test_no_fma.cpp">
<Filter>Test Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="mock_plugin.hpp">
Expand Down
5 changes: 4 additions & 1 deletion ksp_plugin_test/plugin_compatibility_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

namespace principia {
namespace interface {
namespace {

using ::testing::AllOf;
using ::testing::ElementsAre;
Expand Down Expand Up @@ -67,7 +68,8 @@ using namespace std::chrono_literals;
const char preferred_compressor[] = "gipfeli";
const char preferred_encoder[] = "base64";

class PluginCompatibilityTest : public testing::Test {
class PRINCIPIA_CONFIGURABLE_TEST_NAME(PluginCompatibilityTest)
: public testing::Test {
protected:
PluginCompatibilityTest()
: stderrthreshold_(FLAGS_stderrthreshold) {
Expand Down Expand Up @@ -454,5 +456,6 @@ TEST_F(PluginCompatibilityTest, DISABLED_SECULAR_Debug) {
/*decoder=*/"base64");
}

} // namespace
} // namespace interface
} // namespace principia

0 comments on commit 5da3c4e

Please sign in to comment.