Skip to content

Commit

Permalink
.github/workflows/Ubuntu-gcc-latest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dakka committed May 18, 2024
1 parent 15718e8 commit 1afbe56
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Ubuntu-gcc-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:

env:
BUILD_TYPE: Release
CC: gcc-13
CXX: g++-13
CC: gcc-14
CXX: g++-14

jobs:
linux:
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ message("-- Build with all warnings : ${BUILD_ALL_WARNINGS}")
option(BUILD_UNITTESTS "enable building unit tests" true)
message("-- Build unit tests: ${BUILD_UNITTESTS}")

function(build x)
add_executable(${x} examples/${x}.cpp)
function(build loc x)
add_executable(${x} ${loc}/${x}.cpp)
add_dependencies(${x} srcloctest) # srcloctest should be built even if errors with conjure_enum
set_target_properties(${x} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED true)
target_include_directories(${x} PRIVATE include)
Expand All @@ -73,7 +73,7 @@ function(build x)
endfunction()

foreach(x srcloctest example statictest)
build(${x})
build(examples ${x})
if(BUILD_STRIP_EXE)
add_custom_command(TARGET ${x} POST_BUILD COMMAND ${CMAKE_STRIP} ${x})
endif()
Expand All @@ -91,7 +91,7 @@ if(BUILD_UNITTESTS)
include(Catch)
enable_testing()
foreach(x unittests edgetests)
build(${x})
build(utests ${x})
target_link_libraries(${x} PRIVATE Catch2::Catch2WithMain)
catch_discover_tests(${x})
endforeach()
Expand Down
47 changes: 45 additions & 2 deletions examples/statictest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,47 @@
#include <fix8/conjure_enum.hpp>

//-----------------------------------------------------------------------------------------
using namespace FIX8;
enum class component : int { scheme, authority, userinfo, user, password, host, port, path, query, fragment };

namespace TEST
{
enum class NineEnums : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
enum NineEnums1 : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
namespace TEST1
{
enum class NineEnums : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
enum NineEnums1 : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
namespace TEST2::TEST3::TEST4::TEST5
{
enum class NineEnums : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
enum NineEnums1 : int { One, Two, Three, Four, Five, Six, Seven, Eight, Nine };
}
}
}

namespace gsdsp::dsp::fd
{

class AnalysisFrame
{
public:
enum class PrecomputedFrames
{ one };
};
}

namespace gsdsp::utilities
{
template <typename E>
[[nodiscard]]
constexpr size_t countOf()
{
return FIX8::conjure_enum<E>::count();
}
}

//-----------------------------------------------------------------------------------------
enum class component : int { scheme, authority, userinfo, user, password, host, port, path, query, fragment };
using namespace FIX8;

//-----------------------------------------------------------------------------------------
int main(void)
Expand All @@ -48,5 +85,11 @@ int main(void)
std::cout << a << '\n';
for(const auto& a : conjure_enum<component>::unscoped_names)
std::cout << a << '\n';

for(const auto& [a, b] : conjure_enum<TEST::TEST1::TEST2::TEST3::TEST4::TEST5::NineEnums>::entries)
std::cout << conjure_enum<TEST::TEST1::TEST2::TEST3::TEST4::TEST5::NineEnums>::enum_to_int(a) << ' ' << b << '\n';
std::cout << conjure_enum<TEST::TEST1::TEST2::TEST3::TEST4::TEST5::NineEnums>::count() << '\n';

std::cout << gsdsp::utilities::countOf<gsdsp::dsp::fd::AnalysisFrame::PrecomputedFrames>() << '\n';
return 0;
}
File renamed without changes.
File renamed without changes.

0 comments on commit 1afbe56

Please sign in to comment.