ChaiScript / ChaiScript

Compare 0e243b0 ... +16 ... d783266

Coverage Reach
include/chaiscript/language/chaiscript_parser.hpp include/chaiscript/language/chaiscript_eval.hpp include/chaiscript/language/chaiscript_common.hpp include/chaiscript/language/chaiscript_engine.hpp include/chaiscript/language/chaiscript_optimizer.hpp include/chaiscript/language/chaiscript_algebraic.hpp include/chaiscript/language/chaiscript_posix.hpp include/chaiscript/language/chaiscript_tracer.hpp include/chaiscript/language/chaiscript_prelude.hpp include/chaiscript/dispatchkit/dispatchkit.hpp include/chaiscript/dispatchkit/boxed_number.hpp include/chaiscript/dispatchkit/proxy_functions.hpp include/chaiscript/dispatchkit/bootstrap.hpp include/chaiscript/dispatchkit/bootstrap_stl.hpp include/chaiscript/dispatchkit/type_conversions.hpp include/chaiscript/dispatchkit/boxed_value.hpp include/chaiscript/dispatchkit/dynamic_object_detail.hpp include/chaiscript/dispatchkit/boxed_cast_helper.hpp include/chaiscript/dispatchkit/type_info.hpp include/chaiscript/dispatchkit/handle_return.hpp include/chaiscript/dispatchkit/any.hpp include/chaiscript/dispatchkit/dynamic_object.hpp include/chaiscript/dispatchkit/function_params.hpp include/chaiscript/dispatchkit/operators.hpp include/chaiscript/dispatchkit/function_call_detail.hpp include/chaiscript/dispatchkit/function_call.hpp include/chaiscript/dispatchkit/register_function.hpp include/chaiscript/dispatchkit/proxy_functions_detail.hpp include/chaiscript/dispatchkit/exception_specification.hpp include/chaiscript/dispatchkit/bad_boxed_cast.hpp include/chaiscript/dispatchkit/boxed_cast.hpp include/chaiscript/dispatchkit/proxy_constructors.hpp include/chaiscript/dispatchkit/function_signature.hpp include/chaiscript/utility/json.hpp include/chaiscript/utility/json_wrap.hpp include/chaiscript/utility/quick_flat_map.hpp include/chaiscript/utility/static_string.hpp include/chaiscript/utility/utility.hpp include/chaiscript/utility/hash.hpp include/chaiscript/chaiscript_defines.hpp include/chaiscript/chaiscript_threading.hpp include/chaiscript/chaiscript_stdlib.hpp include/chaiscript/chaiscript.hpp unittests/catch.hpp unittests/compiled_tests.cpp unittests/integer_literal_test.cpp unittests/boxed_cast_test.cpp unittests/multithreaded_test.cpp unittests/type_info_test.cpp unittests/multifile_test_module.cpp unittests/c_linkage_test.cpp unittests/multifile_test_main.cpp unittests/multifile_test_chai.cpp unittests/static_chaiscript.cpp src/main.cpp src/test_module.cpp src/stl_extra.cpp src/chaiscript_stdlib_module.cpp static_libs/chaiscript_parser.cpp static_libs/chaiscript_stdlib.cpp

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -713,15 +713,8 @@
Loading
713 713
714 714
  CHECK(Object_Copy_Count_Test::copycount() == 0);
715 715
  CHECK(Object_Copy_Count_Test::constructcount() == 1);
716 -
717 -
718 -
#ifdef CHAISCRIPT_MSVC
719 -
  CHECK(Object_Copy_Count_Test::destructcount() == 3);
720 -
  CHECK(Object_Copy_Count_Test::movecount() == 2);
721 -
#else
722 716
  CHECK(Object_Copy_Count_Test::destructcount() == 2);
723 717
  CHECK(Object_Copy_Count_Test::movecount() == 1);
724 -
#endif
725 718
}
726 719
727 720

@@ -185,7 +185,9 @@
Loading
185 185
            return const_var(c_lhs * c_rhs);
186 186
          case Operators::Opers::difference:
187 187
            return const_var(c_lhs - c_rhs);
188 -
        }
188 +
          default:
189 +
            break;
190 +
          }
189 191
190 192
191 193
        if constexpr (!std::is_floating_point<LHS>::value && !std::is_floating_point<RHS>::value) {
@@ -203,7 +205,9 @@
Loading
203 205
              return const_var(c_lhs | c_rhs);
204 206
            case Operators::Opers::bitwise_xor:
205 207
              return const_var(c_lhs ^ c_rhs);
206 -
          }
208 +
            default:
209 +
              break;
210 +
            }
207 211
        }
208 212
209 213
        if (t_lhs) {
@@ -224,7 +228,9 @@
Loading
224 228
            case Operators::Opers::assign_difference:
225 229
              *t_lhs -= c_rhs;
226 230
              return t_bv;
227 -
          }
231 +
            default:
232 +
              break;
233 +
            }
228 234
229 235
          if constexpr (!std::is_floating_point<LHS>::value && !std::is_floating_point<RHS>::value) {
230 236
            switch (t_oper) {
@@ -247,7 +253,9 @@
Loading
247 253
              case Operators::Opers::assign_bitwise_xor:
248 254
                *t_lhs ^= c_rhs;
249 255
                return t_bv;
250 -
            }
256 +
              default:
257 +
                break;
258 +
              }
251 259
          }
252 260
        }
253 261
@@ -299,21 +307,27 @@
Loading
299 307
                case Operators::Opers::pre_decrement:
300 308
                  --(*lhs);
301 309
                  return t_lhs;
302 -
              }
310 +
                default:
311 +
                  break;
312 +
                }
303 313
            }
304 314
305 315
            switch (t_oper) {
306 316
              case Operators::Opers::unary_minus:
307 317
                return const_var(-c_lhs);
308 318
              case Operators::Opers::unary_plus:
309 319
                return const_var(+c_lhs);
310 -
            }
320 +
              default:
321 +
                break;
322 +
              }
311 323
312 324
            if constexpr (!std::is_floating_point_v<std::decay_t<decltype(c_lhs)>>) {
313 325
              switch (t_oper) {
314 326
                case Operators::Opers::bitwise_complement:
315 327
                  return const_var(~c_lhs);
316 -
              }
328 +
                default:
329 +
                  break;
330 +
                }
317 331
            }
318 332
319 333
            throw chaiscript::detail::exception::bad_any_cast();

@@ -34,7 +34,8 @@
Loading
34 34
          // we now that the Param pack will have only one element, so we are safe expanding it here
35 35
          return Proxy_Function(chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Attribute_Access<Ret, std::decay_t<Param>...>>(std::forward<Func>(func)));
36 36
        } else if constexpr (Is_Member) {
37 -
          auto call = [func = std::forward<Func>(func)](auto && obj, auto && ... param) noexcept(Is_Noexcept) -> decltype(auto) {
37 +
		  // TODO some kind of bug is preventing forwarding of this noexcept for the lambda
38 +
          auto call = [func = std::forward<Func>(func)](auto && obj, auto && ... param) /* noexcept(Is_Noexcept) */ -> decltype(auto) {
38 39
            return (( get_first_param(Function_Params<Param...>{}, obj).*func )(std::forward<decltype(param)>(param)...));
39 40
          };
40 41
          return Proxy_Function(
@@ -87,7 +88,7 @@
Loading
87 88
  template<typename T>
88 89
    Proxy_Function fun(T &&t)
89 90
    {
90 -
      return dispatch::detail::make_callable(std::forward<T>(t), dispatch::detail::Function_Signature{t});
91 +
      return dispatch::detail::make_callable(std::forward<T>(t), dispatch::detail::function_signature(t));
91 92
    }
92 93
93 94

@@ -77,7 +77,7 @@
Loading
77 77
        std::vector<Boxed_Value> convert(Function_Params t_params, const Type_Conversions_State &t_conversions) const
78 78
        {
79 79
          auto vals = t_params.to_vector();
80 -
          constexpr auto dynamic_object_type_info = user_type<Dynamic_Object>();
80 +
          const auto dynamic_object_type_info = user_type<Dynamic_Object>();
81 81
          for (size_t i = 0; i < vals.size(); ++i)
82 82
          {
83 83
            const auto &name = m_types[i].first;
@@ -117,7 +117,7 @@
Loading
117 117
        // second result: needs conversions
118 118
        std::pair<bool, bool> match(const Function_Params &vals, const Type_Conversions_State &t_conversions) const noexcept
119 119
        {
120 -
          constexpr auto dynamic_object_type_info = user_type<Dynamic_Object>();
120 +
          const auto dynamic_object_type_info = user_type<Dynamic_Object>();
121 121
          bool needs_conversion = false;
122 122
123 123
          if (!m_has_types) { return std::make_pair(true, needs_conversion); }
@@ -252,9 +252,9 @@
Loading
252 252
253 253
        static bool compare_type_to_param(const Type_Info &ti, const Boxed_Value &bv, const Type_Conversions_State &t_conversions) noexcept
254 254
        {
255 -
          constexpr auto boxed_value_ti = user_type<Boxed_Value>();
256 -
          constexpr auto boxed_number_ti = user_type<Boxed_Number>();
257 -
          constexpr auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
255 +
          const auto boxed_value_ti = user_type<Boxed_Value>();
256 +
          const auto boxed_number_ti = user_type<Boxed_Number>();
257 +
          const auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
258 258
259 259
          if (ti.is_undef()
260 260
              || ti.bare_equal(boxed_value_ti)
@@ -757,7 +757,7 @@
Loading
757 757
          {
758 758
            return false;
759 759
          }
760 -
          constexpr auto class_type_info = user_type<Class>();
760 +
          const auto class_type_info = user_type<Class>();
761 761
          return vals[0].get_type_info().bare_equal(class_type_info);
762 762
        }
763 763
@@ -844,7 +844,7 @@
Loading
844 844
    namespace detail
845 845
    {
846 846
      template<typename FuncType>
847 -
        bool types_match_except_for_arithmetic(const FuncType &t_func, const Function_Params &plist,
847 +
        bool types_match_except_for_arithmetic(const FuncType &t_func, const chaiscript::Function_Params &plist,
848 848
            const Type_Conversions_State &t_conversions) noexcept
849 849
        {
850 850
          const std::vector<Type_Info> &types = t_func->get_param_types();
@@ -863,7 +863,7 @@
Loading
863 863
        }
864 864
865 865
      template<typename InItr, typename Funcs>
866 -
        Boxed_Value dispatch_with_conversions(InItr begin, const InItr &end, const Function_Params &plist,
866 +
        Boxed_Value dispatch_with_conversions(InItr begin, const InItr &end, const chaiscript::Function_Params &plist,
867 867
            const Type_Conversions_State &t_conversions, const Funcs &t_funcs)
868 868
        {
869 869
          InItr matching_func(end);
@@ -919,7 +919,7 @@
Loading
919 919
                       );
920 920
921 921
          try {
922 -
            return (*(matching_func->second))(Function_Params{newplist}, t_conversions);
922 +
            return (*(matching_func->second))(chaiscript::Function_Params{newplist}, t_conversions);
923 923
          } catch (const exception::bad_boxed_cast &) {
924 924
            //parameter failed to cast
925 925
          } catch (const exception::arity_error &) {

@@ -156,7 +156,7 @@
Loading
156 156
157 157
158 158
      m_engine.add(fun(
159 -
            [=, this](const dispatch::Proxy_Function_Base &t_fun, const std::vector<Boxed_Value> &t_params) -> Boxed_Value {
159 +
            [this](const dispatch::Proxy_Function_Base &t_fun, const std::vector<Boxed_Value> &t_params) -> Boxed_Value {
160 160
              Type_Conversions_State s(this->m_engine.conversions(), this->m_engine.conversions().conversion_saves());
161 161
              return t_fun(Function_Params{t_params}, s);
162 162
            }), "call");
@@ -168,7 +168,7 @@
Loading
168 168
      m_engine.add(fun([this](const std::string &t_type_name){ return m_engine.get_type(t_type_name, true); }), "type");
169 169
170 170
      m_engine.add(fun(
171 -
            [=, this](const Type_Info &t_from, const Type_Info &t_to, const std::function<Boxed_Value (const Boxed_Value &)> &t_func) {
171 +
            [this](const Type_Info &t_from, const Type_Info &t_to, const std::function<Boxed_Value (const Boxed_Value &)> &t_func) {
172 172
              m_engine.add(chaiscript::type_conversion(t_from, t_to, t_func));
173 173
            }
174 174
          ), "add_type_conversion");

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Learn more Showing 31 files with coverage changes found.

Changes in include/chaiscript/dispatchkit/dynamic_object.hpp
-2
Loading file...
Changes in include/chaiscript/dispatchkit/dynamic_object_detail.hpp
-6
Loading file...
Changes in include/chaiscript/dispatchkit/dispatchkit.hpp
-53
Loading file...
Changes in include/chaiscript/language/chaiscript_optimizer.hpp
-46
-3
Loading file...
Changes in include/chaiscript/dispatchkit/handle_return.hpp
-2
Loading file...
Changes in include/chaiscript/utility/json_wrap.hpp
-6
Loading file...
Changes in include/chaiscript/dispatchkit/type_info.hpp
-2
Loading file...
Changes in include/chaiscript/utility/json.hpp
-7
Loading file...
Changes in include/chaiscript/dispatchkit/boxed_value.hpp
-6
Loading file...
Changes in include/chaiscript/language/chaiscript_eval.hpp
-42
-2
Loading file...
Changes in include/chaiscript/language/chaiscript_parser.hpp
-33
Loading file...
Changes in include/chaiscript/dispatchkit/bad_boxed_cast.hpp
-2
Loading file...
Changes in include/chaiscript/language/chaiscript_algebraic.hpp
-18
Loading file...
Changes in include/chaiscript/utility/hash.hpp
-2
Loading file...
Changes in include/chaiscript/chaiscript_stdlib.hpp
-1
Loading file...
Changes in include/chaiscript/dispatchkit/operators.hpp
+2
Loading file...
Changes in include/chaiscript/dispatchkit/bootstrap_stl.hpp
-9
-1
Loading file...
Changes in include/chaiscript/language/chaiscript_engine.hpp
+3
Loading file...
Changes in include/chaiscript/dispatchkit/function_call.hpp
-4
-1
Loading file...
Changes in unittests/catch.hpp
-29
+33
Loading file...
Changes in include/chaiscript/dispatchkit/bootstrap.hpp
-7
-4
Loading file...
Changes in include/chaiscript/dispatchkit/boxed_cast_helper.hpp
-1
-1
Loading file...
Changes in include/chaiscript/dispatchkit/proxy_functions.hpp
-19
-12
Loading file...
Changes in include/chaiscript/dispatchkit/type_conversions.hpp
-10
-15
Loading file...
Changes in include/chaiscript/dispatchkit/any.hpp
-2
Loading file...
Changes in include/chaiscript/utility/utility.hpp
-1
+1
Loading file...
Changes in include/chaiscript/dispatchkit/function_call_detail.hpp
-2
Loading file...
Changes in include/chaiscript/dispatchkit/boxed_number.hpp
-81
+69
Loading file...
Changes in include/chaiscript/dispatchkit/proxy_functions_detail.hpp
-4
+2
Loading file...
Changes in include/chaiscript/dispatchkit/boxed_cast.hpp
-1
-5
Loading file...
Changes in include/chaiscript/dispatchkit/proxy_constructors.hpp
-2
Loading file...

18 Commits

+8
+6
+2
Files Coverage
include/chaiscript +2.04% 90.93%
src 72.79%
static_libs 100.00%
unittests 0.64% 45.97%
Project Totals (60 files) 69.78%
Loading