script_core 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -1
  3. data/ext/enterprise_script_service/libseccomp/.travis.yml +3 -5
  4. data/ext/enterprise_script_service/libseccomp/CHANGELOG +10 -0
  5. data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
  6. data/ext/enterprise_script_service/libseccomp/README.md +18 -0
  7. data/ext/enterprise_script_service/libseccomp/configure.ac +1 -1
  8. data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +7 -0
  9. data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +16 -0
  10. data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +16 -0
  11. data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
  12. data/ext/enterprise_script_service/libseccomp/tests/15-basic-resolver.c +3 -3
  13. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.c +48 -0
  14. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.py +38 -0
  15. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.tests +11 -0
  16. data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
  17. data/ext/enterprise_script_service/libseccomp/tests/regression +4 -0
  18. data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -3
  19. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
  20. data/ext/enterprise_script_service/mruby/.github/workflows/build.yml +106 -0
  21. data/ext/enterprise_script_service/mruby/.github/workflows/main.yml +24 -0
  22. data/ext/enterprise_script_service/mruby/.gitignore +3 -0
  23. data/ext/enterprise_script_service/mruby/.travis.yml +6 -9
  24. data/ext/enterprise_script_service/mruby/AUTHORS +1 -0
  25. data/ext/enterprise_script_service/mruby/Doxyfile +1 -1
  26. data/ext/enterprise_script_service/mruby/LICENSE +1 -1
  27. data/ext/enterprise_script_service/mruby/README.md +6 -2
  28. data/ext/enterprise_script_service/mruby/appveyor.yml +9 -12
  29. data/ext/enterprise_script_service/mruby/appveyor_config.rb +9 -0
  30. data/ext/enterprise_script_service/mruby/build_config.rb +6 -6
  31. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +6 -2
  32. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
  33. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +4 -8
  34. data/ext/enterprise_script_service/mruby/doc/limitations.md +10 -10
  35. data/ext/enterprise_script_service/mruby/doc/opcode.md +108 -95
  36. data/ext/enterprise_script_service/mruby/examples/targets/build_config_ArduinoDue.rb +2 -2
  37. data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelEdison.rb +2 -2
  38. data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelGalileo.rb +2 -2
  39. data/ext/enterprise_script_service/mruby/examples/targets/build_config_RX630.rb +2 -2
  40. data/ext/enterprise_script_service/mruby/examples/targets/build_config_chipKITMax32.rb +2 -2
  41. data/ext/enterprise_script_service/mruby/examples/targets/build_config_dreamcast_shelf.rb +108 -0
  42. data/ext/enterprise_script_service/mruby/include/mrbconf.h +10 -7
  43. data/ext/enterprise_script_service/mruby/include/mruby.h +11 -9
  44. data/ext/enterprise_script_service/mruby/include/mruby/array.h +4 -0
  45. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +11 -2
  46. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +0 -9
  47. data/ext/enterprise_script_service/mruby/include/mruby/common.h +10 -0
  48. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +11 -3
  49. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +1 -17
  50. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +10 -0
  51. data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -1
  52. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +23 -5
  53. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +1 -0
  54. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +3 -2
  55. data/ext/enterprise_script_service/mruby/include/mruby/string.h +2 -1
  56. data/ext/enterprise_script_service/mruby/include/mruby/value.h +7 -12
  57. data/ext/enterprise_script_service/mruby/include/mruby/version.h +4 -4
  58. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +2 -30
  59. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +21 -46
  60. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +9 -0
  61. data/ext/enterprise_script_service/mruby/lib/mruby/source.rb +3 -1
  62. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +7 -0
  63. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +0 -31
  64. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +0 -13
  65. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mrbgem.rake +5 -2
  66. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +0 -1
  67. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +5 -1
  68. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +5 -1
  69. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +7 -11
  70. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +0 -1
  71. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +6 -2
  72. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +6 -2
  73. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +6 -1
  74. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +76 -48
  75. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +107 -32
  76. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/y.tab.c +13153 -0
  77. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/mrbgem.rake +13 -15
  78. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +3 -3
  79. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +2 -213
  80. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +21 -0
  81. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +1 -3
  82. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/include/mruby/ext/io.h +39 -7
  83. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +2 -8
  84. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file_constants.rb +0 -16
  85. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +7 -12
  86. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +76 -30
  87. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +9 -10
  88. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +323 -120
  89. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +18 -12
  90. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +32 -0
  91. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +57 -49
  92. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +15 -17
  93. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +9 -0
  94. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +1 -1
  95. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +3 -12
  96. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +113 -10
  97. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +5 -1
  98. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +2 -2
  99. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +9 -9
  100. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/src/mrb_sleep.c +1 -1
  101. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrbgem.rake +1 -1
  102. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/test/sockettest.c +3 -2
  103. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +61 -24
  104. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +5 -23
  105. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +3 -3
  106. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +1 -1
  107. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +1 -0
  108. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +6 -5
  109. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +3 -3
  110. data/ext/enterprise_script_service/mruby/src/array.c +11 -0
  111. data/ext/enterprise_script_service/mruby/src/backtrace.c +2 -2
  112. data/ext/enterprise_script_service/mruby/src/class.c +26 -11
  113. data/ext/enterprise_script_service/mruby/src/codedump.c +4 -0
  114. data/ext/enterprise_script_service/mruby/src/debug.c +8 -5
  115. data/ext/enterprise_script_service/mruby/src/dump.c +3 -65
  116. data/ext/enterprise_script_service/mruby/src/error.c +57 -5
  117. data/ext/enterprise_script_service/mruby/src/etc.c +13 -4
  118. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +98 -21
  119. data/ext/enterprise_script_service/mruby/src/gc.c +10 -275
  120. data/ext/enterprise_script_service/mruby/src/hash.c +5 -6
  121. data/ext/enterprise_script_service/mruby/src/kernel.c +2 -2
  122. data/ext/enterprise_script_service/mruby/src/load.c +56 -30
  123. data/ext/enterprise_script_service/mruby/src/numeric.c +22 -10
  124. data/ext/enterprise_script_service/mruby/src/object.c +12 -4
  125. data/ext/enterprise_script_service/mruby/src/print.c +27 -3
  126. data/ext/enterprise_script_service/mruby/src/proc.c +21 -1
  127. data/ext/enterprise_script_service/mruby/src/state.c +34 -11
  128. data/ext/enterprise_script_service/mruby/src/string.c +69 -35
  129. data/ext/enterprise_script_service/mruby/src/symbol.c +12 -10
  130. data/ext/enterprise_script_service/mruby/src/vm.c +21 -30
  131. data/ext/enterprise_script_service/mruby/tasks/gitlab.rake +19 -22
  132. data/ext/enterprise_script_service/mruby/tasks/mrbgems.rake +1 -1
  133. data/ext/enterprise_script_service/mruby/tasks/toolchains/android.rake +46 -1
  134. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +3 -3
  135. data/ext/enterprise_script_service/mruby/tasks/toolchains/openwrt.rake +6 -6
  136. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +8 -8
  137. data/ext/enterprise_script_service/mruby/test/assert.rb +5 -4
  138. data/ext/enterprise_script_service/mruby/test/t/ensure.rb +8 -26
  139. data/ext/enterprise_script_service/mruby/test/t/exception.rb +2 -2
  140. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +8 -24
  141. data/ext/enterprise_script_service/mruby/travis_config.rb +0 -14
  142. data/ext/enterprise_script_service/msgpack/.github/depends/boost.sh +56 -0
  143. data/ext/enterprise_script_service/msgpack/.github/workflows/coverage.yml +62 -0
  144. data/ext/enterprise_script_service/msgpack/.github/workflows/gha.yml +304 -0
  145. data/ext/enterprise_script_service/msgpack/CHANGELOG.md +11 -0
  146. data/ext/enterprise_script_service/msgpack/CMakeLists.txt +82 -39
  147. data/ext/enterprise_script_service/msgpack/Files.cmake +22 -12
  148. data/ext/enterprise_script_service/msgpack/QUICKSTART-C.md +26 -29
  149. data/ext/enterprise_script_service/msgpack/README.md +3 -2
  150. data/ext/enterprise_script_service/msgpack/appveyor.yml +6 -2
  151. data/ext/enterprise_script_service/msgpack/ci/build_cmake.sh +3 -1
  152. data/ext/enterprise_script_service/msgpack/cmake/CodeCoverage.cmake +55 -0
  153. data/ext/enterprise_script_service/msgpack/codecov.yml +36 -0
  154. data/ext/enterprise_script_service/msgpack/example/CMakeLists.txt +9 -5
  155. data/ext/enterprise_script_service/msgpack/example/boost/CMakeLists.txt +1 -1
  156. data/ext/enterprise_script_service/msgpack/example/c/CMakeLists.txt +17 -6
  157. data/ext/enterprise_script_service/msgpack/example/c/boundary.c +296 -0
  158. data/ext/enterprise_script_service/msgpack/example/c/jsonconv.c +419 -0
  159. data/ext/enterprise_script_service/msgpack/example/c/simple_c.c +1 -1
  160. data/ext/enterprise_script_service/msgpack/example/cpp03/CMakeLists.txt +3 -3
  161. data/ext/enterprise_script_service/msgpack/example/cpp11/CMakeLists.txt +2 -2
  162. data/ext/enterprise_script_service/msgpack/example/x3/CMakeLists.txt +2 -2
  163. data/ext/enterprise_script_service/msgpack/include/msgpack/pack.h +24 -1
  164. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +5 -4
  165. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/boost/optional.hpp +4 -4
  166. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp17/vector_byte.hpp +8 -8
  167. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/map.hpp +4 -4
  168. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector.hpp +4 -4
  169. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_char.hpp +8 -8
  170. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_unsigned_char.hpp +8 -8
  171. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +4 -4
  172. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/unpack.hpp +6 -6
  173. data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
  174. data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +4 -4
  175. data/ext/enterprise_script_service/msgpack/make_file_list.sh +38 -11
  176. data/ext/enterprise_script_service/msgpack/src/vrefbuffer.c +6 -0
  177. data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +86 -64
  178. data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +4 -0
  179. data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +4 -0
  180. data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +4 -0
  181. data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +4 -1
  182. data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +4 -0
  183. data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +4 -0
  184. data/ext/enterprise_script_service/msgpack/test/buffer.cpp +4 -47
  185. data/ext/enterprise_script_service/msgpack/test/buffer_c.cpp +148 -0
  186. data/ext/enterprise_script_service/msgpack/test/carray.cpp +4 -0
  187. data/ext/enterprise_script_service/msgpack/test/cases.cpp +8 -4
  188. data/ext/enterprise_script_service/msgpack/test/convert.cpp +8 -4
  189. data/ext/enterprise_script_service/msgpack/test/fixint.cpp +4 -0
  190. data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +4 -0
  191. data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +4 -0
  192. data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +4 -0
  193. data/ext/enterprise_script_service/msgpack/test/json.cpp +4 -0
  194. data/ext/enterprise_script_service/msgpack/test/limit.cpp +8 -4
  195. data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +4 -0
  196. data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +159 -0
  197. data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +4 -0
  198. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +32 -27
  199. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +4 -0
  200. data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +4 -0
  201. data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +4 -1
  202. data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +4 -0
  203. data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +4 -0
  204. data/ext/enterprise_script_service/msgpack/test/object.cpp +4 -1
  205. data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +12 -8
  206. data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +30 -26
  207. data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +4 -0
  208. data/ext/enterprise_script_service/msgpack/test/raw.cpp +4 -0
  209. data/ext/enterprise_script_service/msgpack/test/reference.cpp +4 -0
  210. data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +4 -0
  211. data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +4 -0
  212. data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +4 -0
  213. data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +4 -0
  214. data/ext/enterprise_script_service/msgpack/test/streaming.cpp +8 -4
  215. data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +4 -0
  216. data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +4 -0
  217. data/ext/enterprise_script_service/msgpack/test/user_class.cpp +16 -12
  218. data/ext/enterprise_script_service/msgpack/test/version.cpp +4 -0
  219. data/ext/enterprise_script_service/msgpack/test/visitor.cpp +4 -0
  220. data/ext/enterprise_script_service/msgpack/test/zone.cpp +4 -0
  221. data/lib/script_core/version.rb +1 -1
  222. data/script_core.gemspec +1 -1
  223. metadata +23 -9
  224. data/ext/enterprise_script_service/msgpack/.travis.yml +0 -258
@@ -56,7 +56,9 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil)
56
56
  msg = "#{err}#{str}"
57
57
  msg += " [#{iso}]" if iso && !iso.empty?
58
58
  msg += " => #{e}" if e && !e.to_s.empty?
59
- msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})"
59
+ if Object.const_defined?(:GEMNAME)
60
+ msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})"
61
+ end
60
62
  if $mrbtest_assert
61
63
  $mrbtest_assert.each do |idx, assert_msg, diff|
62
64
  msg += "\n - Assertion[#{idx}]"
@@ -64,7 +66,7 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil)
64
66
  msg += "\n#{diff}" if diff && !diff.empty?
65
67
  end
66
68
  end
67
- msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt
69
+ msg += "\nbacktrace:\n #{bt.join("\n ")}" if bt && !bt.empty?
68
70
  msg
69
71
  end
70
72
 
@@ -122,8 +124,7 @@ class << $mrbtest_assert_idx
122
124
  $mrbtest_child_noassert[-2] += 1
123
125
  t_print('?')
124
126
  rescue Exception => e
125
- bt = e.backtrace if $mrbtest_verbose
126
- $asserts.push(assertion_string("#{e.class}: ", str, iso, e, bt))
127
+ $asserts.push(assertion_string("#{e.class}: ", str, iso, e, e.backtrace))
127
128
  $kill_test += 1
128
129
  t_print('X')
129
130
  ensure
@@ -1,16 +1,16 @@
1
1
  ##
2
2
  # ensure Test
3
3
 
4
- assert('ensure - context - yield') do
5
- class EnsureYieldBreak
6
- attr_reader :ensure_context
7
- def try
8
- yield
9
- ensure
10
- @ensure_context = self
11
- end
4
+ class EnsureYieldBreak
5
+ attr_reader :ensure_context
6
+ def try
7
+ yield
8
+ ensure
9
+ @ensure_context = self
12
10
  end
11
+ end
13
12
 
13
+ assert('ensure - context - yield') do
14
14
  yielder = EnsureYieldBreak.new
15
15
  yielder.try do
16
16
  end
@@ -18,15 +18,6 @@ def try
18
18
  end
19
19
 
20
20
  assert('ensure - context - yield and break') do
21
- class EnsureYieldBreak
22
- attr_reader :ensure_context
23
- def try
24
- yield
25
- ensure
26
- @ensure_context = self
27
- end
28
- end
29
-
30
21
  yielder = EnsureYieldBreak.new
31
22
  yielder.try do
32
23
  break
@@ -35,15 +26,6 @@ def try
35
26
  end
36
27
 
37
28
  assert('ensure - context - yield and return') do
38
- class EnsureYieldBreak
39
- attr_reader :ensure_context
40
- def try
41
- yield
42
- ensure
43
- @ensure_context = self
44
- end
45
- end
46
-
47
29
  yielder = EnsureYieldBreak.new
48
30
  lambda do
49
31
  yielder.try do
@@ -400,7 +400,7 @@ def backtrace_available?
400
400
  end
401
401
  rescue => exception
402
402
  GC.start
403
- assert_equal("#{__FILE__}:#{line}:in call",
403
+ assert_equal("#{__FILE__}:#{line}",
404
404
  exception.backtrace.first)
405
405
  end
406
406
  end
@@ -418,7 +418,7 @@ def backtrace_available?
418
418
  rescue => exception
419
419
  [3].each do
420
420
  end
421
- assert_equal("#{__FILE__}:#{line}:in call",
421
+ assert_equal("#{__FILE__}:#{line}",
422
422
  exception.backtrace.first)
423
423
  end
424
424
  end
@@ -29,7 +29,7 @@ def bg_try(&b)
29
29
  end
30
30
  end
31
31
 
32
- # Kernel.eval is provided by the mruby-gem mrbgem. '15.3.1.2.3'
32
+ # Kernel.eval is provided by the mruby-eval mrbgem. '15.3.1.2.3'
33
33
 
34
34
  assert('Kernel.iterator?', '15.3.1.2.5') do
35
35
  assert_false Kernel.iterator?
@@ -59,20 +59,11 @@ def bg_try(&b)
59
59
  assert_equal 100, i
60
60
  end
61
61
 
62
- assert('Kernel.p', '15.3.1.2.9') do
63
- # TODO search for a way to test p to stdio
64
- assert_true true
65
- end
62
+ # Kernel.p is provided by the mruby-print mrbgem. '15.3.1.2.9'
66
63
 
67
- assert('Kernel.print', '15.3.1.2.10') do
68
- # TODO search for a way to test print to stdio
69
- assert_true true
70
- end
64
+ # Kernel.print is provided by the mruby-print mrbgem. '15.3.1.2.10'
71
65
 
72
- assert('Kernel.puts', '15.3.1.2.11') do
73
- # TODO search for a way to test puts to stdio
74
- assert_true true
75
- end
66
+ # Kernel.puts is provided by the mruby-print mrbgem. '15.3.1.2.11'
76
67
 
77
68
  assert('Kernel.raise', '15.3.1.2.12') do
78
69
  assert_raise RuntimeError do
@@ -100,6 +91,10 @@ def bg_try(&b)
100
91
  assert_true __send__(:respond_to?, :nil?)
101
92
  # test without argument and without block
102
93
  assert_equal String, __send__(:to_s).class
94
+
95
+ args = [:respond_to?, :nil?]
96
+ assert_true __send__(*args)
97
+ assert_equal [:respond_to?, :nil?], args
103
98
  end
104
99
 
105
100
  assert('Kernel#block_given?', '15.3.1.3.6') do
@@ -197,17 +192,6 @@ def a.test
197
192
  a.set(2)
198
193
  c = a.dup
199
194
 
200
- immutables = [ 1, :foo, true, false, nil ]
201
- error_count = 0
202
- immutables.each do |i|
203
- begin
204
- i.dup
205
- rescue TypeError
206
- error_count += 1
207
- end
208
- end
209
-
210
- assert_equal immutables.size, error_count
211
195
  assert_equal 2, a.get
212
196
  assert_equal 1, b.get
213
197
  assert_equal 2, c.get
@@ -1,17 +1,3 @@
1
- MRuby::Build.new('debug') do |conf|
2
- toolchain :gcc
3
- enable_debug
4
-
5
- # include all core GEMs
6
- conf.gembox 'full-core'
7
- conf.cc.flags += %w(-Werror=declaration-after-statement)
8
- conf.compilers.each do |c|
9
- c.defines += %w(MRB_GC_STRESS MRB_GC_FIXED_ARENA MRB_METHOD_CACHE)
10
- end
11
-
12
- build_mrbc_exec
13
- end
14
-
15
1
  MRuby::Build.new('full-debug') do |conf|
16
2
  toolchain :gcc
17
3
  enable_debug
@@ -0,0 +1,56 @@
1
+ #!/bin/sh
2
+
3
+ usage()
4
+ {
5
+ cat <<EOL
6
+ -b - 32-bit or 64-bit library, maybe 32, 64 or both
7
+ -t - the toolset, maybe gcc, clang or both
8
+ EOL
9
+ }
10
+
11
+ build_boost()
12
+ {
13
+ BASE=`pwd`/..
14
+ ./b2 -j4 --toolset=$1 --prefix=${BASE}/usr --libdir="${BASE}/usr/$1/lib$2" --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=$2 install
15
+ }
16
+
17
+ bit="64"
18
+ toolset="gcc"
19
+
20
+ while getopts "b:t:" c; do
21
+ case "$c" in
22
+ b)
23
+ bit="$OPTARG"
24
+ [ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
25
+ ;;
26
+ t)
27
+ toolset="$OPTARG"
28
+ [ "$toolset" != "gcc" ] && [ "$toolset" != "clang" ] && [ "$toolset" != "both" ] && usage && exit 1
29
+ ;;
30
+ ?*)
31
+ echo "invalid arguments." && exit 1
32
+ ;;
33
+ esac
34
+ done
35
+
36
+ wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2
37
+ tar xf boost_1_71_0.tar.bz2
38
+ cd boost_1_71_0
39
+ ./bootstrap.sh
40
+
41
+ build()
42
+ {
43
+ if [ "$bit" = "both" ]; then
44
+ build_boost $1 32
45
+ build_boost $1 64
46
+ else
47
+ build_boost $1 $bit
48
+ fi
49
+ }
50
+
51
+ if [ "$toolset" = "both" ]; then
52
+ build gcc
53
+ build clang
54
+ else
55
+ build $toolset
56
+ fi
@@ -0,0 +1,62 @@
1
+ name: coverage
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+ push:
7
+ branches:
8
+ - master
9
+ tags:
10
+ - '*'
11
+
12
+ jobs:
13
+
14
+ codecov:
15
+ timeout-minutes: 30
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v1
20
+ - name: install depends
21
+ run: |
22
+ sudo apt-get update
23
+ sudo apt-get install g++-multilib lcov
24
+ - name: Cache boost
25
+ id: cache-boost
26
+ uses: actions/cache@v1
27
+ with:
28
+ path: usr
29
+ key: ${{ runner.os }}-boost-20200107
30
+ - name: Build boost
31
+ if: steps.cache-boost.outputs.cache-hit != 'true'
32
+ run: ./.github/depends/boost.sh -b both -t gcc
33
+ - name: Compile tests
34
+ run: |
35
+ # install gtest
36
+ BASE=`pwd`
37
+ wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
38
+ unzip -q googletest-release-1.7.0.zip
39
+ cd googletest-release-1.7.0
40
+ g++ -m64 src/gtest-all.cc -I. -Iinclude -c -fPIC
41
+ g++ -m64 src/gtest_main.cc -I. -Iinclude -c -fPIC
42
+ ar -rv libgtest.a gtest-all.o
43
+ ar -rv libgtest_main.a gtest_main.o
44
+ mkdir -p ${BASE}/usr/include
45
+ cp -r include/gtest ${BASE}/usr/include
46
+ mkdir -p ${BASE}/usr/lib
47
+ mv *.a ${BASE}/usr/lib
48
+ cd ..
49
+
50
+ mkdir build && cd build
51
+ CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_BOOST=ON -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_ENABLE_CXX=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
52
+ make -j4
53
+ make test
54
+ - name: Upload coverage to Codecov
55
+ working-directory: build
56
+ run: |
57
+ # Create lcov report
58
+ lcov --capture --directory . --output-file coverage.info
59
+ lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
60
+ lcov --list coverage.info # debug info
61
+ # Uploading report to CodeCov
62
+ bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
@@ -0,0 +1,304 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+ push:
7
+ branches:
8
+ - master
9
+ tags:
10
+ - '*'
11
+
12
+ jobs:
13
+ macos:
14
+ runs-on: macos-latest
15
+ strategy:
16
+ matrix:
17
+ pattern: [0, 1, 2, 3]
18
+ steps:
19
+ - uses: actions/checkout@v1
20
+ - name: Cache boost
21
+ id: cache-boost
22
+ uses: actions/cache@v1
23
+ with:
24
+ path: usr
25
+ key: ${{ runner.os }}-boost-20200107
26
+ - name: Build boost
27
+ if: steps.cache-boost.outputs.cache-hit != 'true'
28
+ run: ./.github/depends/boost.sh -b 64 -t clang
29
+ - name: build and test
30
+ env:
31
+ CC: clang
32
+ CXX: clang++
33
+ shell: bash
34
+ run: |
35
+ BASE=`pwd`;
36
+
37
+ # matrix config
38
+ if [ ${{ matrix.pattern }} == 0 ]; then
39
+ ACTION="ci/build_cmake.sh"
40
+ export CXX17="ON"
41
+ export ARCH="64"
42
+ export BOOST="ON"
43
+ SHARED="ON"
44
+ export CHAR_SIGN="unsigned"
45
+ export API_VERSION="1"
46
+ fi
47
+ if [ ${{ matrix.pattern }} == 1 ]; then
48
+ ACTION="ci/build_cmake.sh"
49
+ export CXX17="ON"
50
+ export ARCH="64"
51
+ export BOOST="ON"
52
+ export SHARED="ON"
53
+ export CHAR_SIGN="signed"
54
+ export API_VERSION="3"
55
+ fi
56
+ if [ ${{ matrix.pattern }} == 2 ]; then
57
+ ACTION="ci/build_cmake.sh"
58
+ export CXX17="ON"
59
+ export ARCH="64"
60
+ export SHARED="ON"
61
+ export CHAR_SIGN="signed"
62
+ export API_VERSION="2"
63
+ fi
64
+ if [ ${{ matrix.pattern }} == 3 ]; then
65
+ ACTION="ci/build_cmake.sh"
66
+ export ARCH="64"
67
+ export SHARED="ON"
68
+ export CHAR_SIGN="unsigned"
69
+ export API_VERSION="2"
70
+ fi
71
+
72
+ # install gtest
73
+ wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
74
+ unzip -q googletest-release-1.7.0.zip
75
+ cd googletest-release-1.7.0
76
+ $CXX -m${ARCH} src/gtest-all.cc -I. -Iinclude -c
77
+ $CXX -m${ARCH} src/gtest_main.cc -I. -Iinclude -c
78
+ ar -rv libgtest.a gtest-all.o
79
+ ar -rv libgtest_main.a gtest_main.o
80
+ mkdir -p ${BASE}/usr/include
81
+ cp -r include/gtest ${BASE}/usr/include
82
+ mkdir -p ${BASE}/usr/lib
83
+ mv *.a ${BASE}/usr/lib
84
+ cd ..
85
+
86
+ # build and test
87
+ CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/clang/lib${ARCH}/cmake" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" ${ACTION}
88
+ cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
89
+
90
+ linux:
91
+ runs-on: ubuntu-18.04
92
+ strategy:
93
+ matrix:
94
+ pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
95
+ steps:
96
+ - uses: actions/checkout@v1
97
+ - name: install depends
98
+ run: |
99
+ sudo apt-get update
100
+ sudo apt-get install g++-multilib clang-8 valgrind
101
+ - name: Cache boost
102
+ id: cache-boost
103
+ uses: actions/cache@v1
104
+ with:
105
+ path: usr
106
+ key: ${{ runner.os }}-boost-20200107
107
+ - name: Build boost
108
+ if: steps.cache-boost.outputs.cache-hit != 'true'
109
+ run: ./.github/depends/boost.sh -b both -t gcc
110
+ - name: build and test
111
+ shell: bash
112
+ run: |
113
+ BASE=`pwd`;
114
+
115
+ # matrix config
116
+ if [ ${{ matrix.pattern }} == 0 ]; then
117
+ export CC=clang
118
+ export CXX=clang++
119
+ ACTION="ci/build_cmake.sh"
120
+ export ARCH="64"
121
+ export BOOST="ON"
122
+ export SHARED="ON"
123
+ export CHAR_SIGN="unsigned"
124
+ export API_VERSION="2"
125
+ fi
126
+ if [ ${{ matrix.pattern }} == 1 ]; then
127
+ export CC=clang
128
+ export CXX=clang++
129
+ ACTION="ci/build_cmake.sh"
130
+ export ARCH="32"
131
+ export SHARED="ON"
132
+ export CHAR_SIGN="signed"
133
+ export API_VERSION="2"
134
+ fi
135
+ if [ ${{ matrix.pattern }} == 2 ]; then
136
+ export CC=clang
137
+ export CXX=clang++
138
+ ACTION="ci/build_cmake.sh"
139
+ export CXX17="ON"
140
+ export ARCH="64"
141
+ export BOOST="ON"
142
+ export SHARED="ON"
143
+ export CHAR_SIGN="signed"
144
+ export API_VERSION="3"
145
+ export X3_PARSE="ON"
146
+ fi
147
+ if [ ${{ matrix.pattern }} == 3 ]; then
148
+ export CC=clang
149
+ export CXX=clang++
150
+ ACTION="ci/build_cmake.sh"
151
+ export CXX17="ON"
152
+ export ARCH="32"
153
+ export SHARED="OFF"
154
+ export CHAR_SIGN="unsigned"
155
+ export API_VERSION="2"
156
+ fi
157
+ if [ ${{ matrix.pattern }} == 4 ]; then
158
+ export CC=gcc
159
+ export CXX=g++
160
+ ACTION="ci/build_cmake.sh"
161
+ export CXX17="ON"
162
+ export ARCH="64"
163
+ export SHARED="ON"
164
+ export CHAR_SIGN="signed"
165
+ export API_VERSION="2"
166
+ fi
167
+ if [ ${{ matrix.pattern }} == 5 ]; then
168
+ export CC=gcc
169
+ export CXX=g++
170
+ ACTION="ci/build_cmake.sh"
171
+ export CXX17="ON"
172
+ export ARCH="32"
173
+ export BOOST="ON"
174
+ export SHARED="ON"
175
+ export CHAR_SIGN="unsigned"
176
+ export API_VERSION="3"
177
+ export X3_PARSE="ON"
178
+ fi
179
+ if [ ${{ matrix.pattern }} == 6 ]; then
180
+ export CC=gcc
181
+ export CXX=g++
182
+ ACTION="ci/build_cmake.sh"
183
+ export ARCH="64"
184
+ export SHARED="ON"
185
+ export CHAR_SIGN="unsigned"
186
+ export API_VERSION="2"
187
+ fi
188
+ if [ ${{ matrix.pattern }} == 7 ]; then
189
+ export CC=gcc
190
+ export CXX=g++
191
+ ACTION="ci/build_cmake.sh"
192
+ export ARCH="32"
193
+ export BOOST="ON"
194
+ export SHARED="OFF"
195
+ export CHAR_SIGN="signed"
196
+ export API_VERSION="1"
197
+ fi
198
+ if [ ${{ matrix.pattern }} == 8 ]; then
199
+ export CC=gcc
200
+ export CXX=g++
201
+ ACTION="ci/build_cmake.sh"
202
+ export ARCH="32"
203
+ export BOOST="ON"
204
+ export SHARED="OFF"
205
+ export CHAR_SIGN="signed"
206
+ export API_VERSION="2"
207
+ fi
208
+ if [ ${{ matrix.pattern }} == 9 ]; then
209
+ export CC=clang
210
+ export CXX=clang++
211
+ ACTION="ci/build_regression.sh"
212
+ export ARCH="64"
213
+ export SAN="UBSAN"
214
+ export MSGPACK_FUZZ_REGRESSION="ON"
215
+ export CTEST_OUTPUT_ON_FAILURE=1
216
+ fi
217
+ if [ ${{ matrix.pattern }} == 10 ]; then
218
+ export CC=clang
219
+ export CXX=clang++
220
+ ACTION="ci/build_regression.sh"
221
+ export ARCH="64"
222
+ export SAN="ASAN"
223
+ export MSGPACK_FUZZ_REGRESSION="ON"
224
+ export CTEST_OUTPUT_ON_FAILURE=1
225
+ fi
226
+ if [ ${{ matrix.pattern }} == 11 ]; then
227
+ export CC=gcc
228
+ export CXX=g++
229
+ ACTION="ci/build_cmake_embedded.sh"
230
+ export ARCH="64"
231
+ fi
232
+
233
+ # install gtest
234
+ wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
235
+ unzip -q googletest-release-1.7.0.zip
236
+ cd googletest-release-1.7.0
237
+ $CXX -m${ARCH} src/gtest-all.cc -I. -Iinclude -c -fPIC
238
+ $CXX -m${ARCH} src/gtest_main.cc -I. -Iinclude -c -fPIC
239
+ ar -rv libgtest.a gtest-all.o
240
+ ar -rv libgtest_main.a gtest_main.o
241
+ mkdir -p ${BASE}/usr/include
242
+ cp -r include/gtest ${BASE}/usr/include
243
+ mkdir -p ${BASE}/usr/lib
244
+ mv *.a ${BASE}/usr/lib
245
+ cd ..
246
+
247
+ # install zlib
248
+ if [ ${ARCH} == 32 ]; then
249
+ sudo apt-get install lib32z1-dev
250
+ fi
251
+
252
+ # build and test
253
+ CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib${ARCH}/cmake" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" MSGPACK_SAN="${SAN}" ${ACTION}
254
+ cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
255
+ windows:
256
+ runs-on: windows-2016
257
+ strategy:
258
+ matrix:
259
+ pattern: [0, 1, 2, 3]
260
+ steps:
261
+ - uses: actions/checkout@v1
262
+ - name: Cache vcpkg
263
+ id: cache-vcpkg
264
+ uses: actions/cache@v1.0.3
265
+ with:
266
+ path: C:/vcpkg/installed/x64-windows
267
+ key: ${{ runner.os }}-vcpkg
268
+ - name: Build dependencies
269
+ if: steps.cache-vcpkg.outputs.cache-hit != 'true'
270
+ shell: powershell
271
+ run: |
272
+ vcpkg install gtest:x64-windows
273
+ vcpkg install zlib:x64-windows
274
+ - name: Build and test
275
+ shell: powershell
276
+ run: |
277
+ if (${{ matrix.pattern }} -eq 0) {
278
+ $CPP11="-DMSGPACK_CXX11=OFF"
279
+ $BOOST="-DMSGPACK_BOOST=OFF"
280
+ }
281
+ if (${{ matrix.pattern }} -eq 1) {
282
+ $CPP11="-DMSGPACK_CXX11=OFF"
283
+ $BOOST="-DMSGPACK_BOOST=ON"
284
+ }
285
+ if (${{ matrix.pattern }} -eq 2) {
286
+ $CPP11="-DMSGPACK_CXX11=ON"
287
+ $BOOST="-DMSGPACK_BOOST=OFF"
288
+ }
289
+ if (${{ matrix.pattern }} -eq 3) {
290
+ $CPP11="-DMSGPACK_CXX11=ON"
291
+ $BOOST="-DMSGPACK_BOOST=ON"
292
+ }
293
+
294
+ $CUR=(Get-Location).Path
295
+ md build
296
+ cd build
297
+ cmake -A x64 -DBOOST_ROOT="$env:BOOST_ROOT_1_72_0" -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" $CPP11 $BOOST "-DCMAKE_CXX_FLAGS=/D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" ..
298
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
299
+ cmake --build . --config Release
300
+ $pathbak="$env:PATH"
301
+ $env:PATH="C:\vcpkg\installed\x64-windows\bin;$CUR\build\Release;$pathbak"
302
+ ctest -V
303
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
304
+ $env:PATH=$pathbak