-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #5178 - Init the RUBY_DESCRIPTION properly #5179
Conversation
f6daad1
to
8154024
Compare
struct ruby_cmdline_options; | ||
typedef struct ruby_cmdline_options ruby_cmdline_options_t; | ||
void Init_ruby_description(ruby_cmdline_options_t*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forward declare.
In 2.7.2, it was simpler, just void Init_ruby_description(void)
@@ -22,6 +25,8 @@ void RubyEngine::initRubyEngine() { | |||
RUBY_INIT_STACK; | |||
ruby_init(); | |||
|
|||
Init_ruby_description(nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use it.
We don't just MJIT or YJIT, so it just doesn't use the param ruby_cmdline_options_t *opt
anyways.
See https://github.com/ruby/ruby/blob/e51014f9c05aa65cbf203442d37fef7c12390015/version.c#L129-L162
class ConstantsTest < Minitest::Test | ||
|
||
# Note: putting all of these tests under the same one because of the way we | ||
# run the tests with the CLI (we run a CLI instance for each individual test, | ||
# and it takes almost 20 seconds for each which is ridiculous) | ||
def test_ruby_constants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new test. Grouping everything under a single minitest because it is WWAAAAAY to slow otherwise with the CLI.
refute_empty(RUBY_DESCRIPTION) | ||
assert_match(/ruby 3.2.2 \(.*\) \[.*\]/, RUBY_DESCRIPTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before fix
Run options: --seed 12379
# Running:
E
Finished in 0.001386s, 721.3269 runs/s, 721.3269 assertions/s.
1) Error:
ConstantsTest#test_ruby_constants:
NameError: uninitialized constant ConstantsTest::RUBY_DESCRIPTION
eval:414:in `const_missing'
/home/julien/Software/Others/OpenStudio/ruby/test/Constants_Test.rb:17:in `test_ruby_constants'
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips
boost::optional<int> month_ = getInt(OS_SizingPeriod_DesignDayFields::Month); | ||
if (month_ && (*month_ == 2)) { | ||
boost::optional<int> day_ = this->getInt(OS_SizingPeriod_DesignDayFields::DayofMonth); | ||
if (day_ && (*day_ == 29)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but fix cppcheck workflow that has been failing for some time
CI Results for 8154024:
|
Pull request overview
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.