jamboree / bustache

C++20 implementation of {{ mustache }}
82 stars 10 forks source link

Can't compile tests #2

Closed kainjow closed 7 years ago

kainjow commented 7 years ago

I just found your benchmark program, which is great! I'd like to improve my implementation's performance and am trying to compile your program. I can compile the library but once I try enabling tests I get some errors.

Here are my steps:

mkdir build && cd build
cmake -DCATCH_INCLUDE_DIR=/path/to/Mustache -DBUSTACHE_ENABLE_TESTING=ON ..
cmake --build .

The first error:

/test/specs.cpp:655:46: error: no matching constructor for initialization of 'object' (aka 'unordered_map<basic_string<char, char_traits, allocator >, bustache::value>') CHECK(to_string("Hello, {{lambda}}!"_fmt(object{{"lambda", [] { return "world"; }}})) == "Hello, world!"); ^ ~~~~~~~~

Note that I installed Boost via Homebrew, so it's using version 1.63.0. Also since I'm using my project's include directory which includes the latest catch.hpp maybe that's an issue as well.

Also, maybe the benchmark program should verify the rendered value matches an expected value, otherwise it's not clear whether an implementation is even functioning properly.

jamboree commented 7 years ago

It's not an issue with Catch or Boost. It's related to this problem. The problem doesn't show up with MSVC (which I tested), I'll see how I can do with it.

Thanks for report!

kainjow commented 7 years ago

Thanks, it compiles now. However, I assumed benchmark.cpp would be compiled, but it doesn't look like it's used in the CMakeLists file?

Edit: I threw something together to get it to work.