Skip to content

Improve test reporting with meson#16

Open
oreo639 wants to merge 2 commits intofujiwarat:mainfrom
oreo639:meson-fix-tests
Open

Improve test reporting with meson#16
oreo639 wants to merge 2 commits intofujiwarat:mainfrom
oreo639:meson-fix-tests

Conversation

@oreo639
Copy link
Copy Markdown

@oreo639 oreo639 commented Feb 4, 2026

Currently, the tests always exit with 0, even when they encounter an error, this results in meson always treating the test as a success.
Notably, the tests don't run correctly with meson test -C build --verbose, since the CWDs aren't set correctly, this also fixes that.

Keep in mind that meson still reports success despite #14 since the test itself doesn't error, although I can look into updating or adding a test for that later.

The prediction test is currently commented out since it relies on predictions in ~/.config/anthy (it is still built though).

Copy link
Copy Markdown
Owner

@fujiwarat fujiwarat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch. I added some comments.

if (res) {
printf("failed to init\n");
fprintf(stderr, "failed to init\n");
return 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be also good to replace 1 with EXIT_FAILURE.

if (res) {
printf("failed to init\n");
fprintf(stderr, "failed to init\n");
return 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

if (!ac) {
printf("failed to create context\n");
fprintf(stderr, "failed to create context\n");
return 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

return 1;
}
anthy_release_context(ac);
return 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be also good to replace 0 with EXIT_SUCCESS.

if (!ac) {
printf("failed to create context\n");
fprintf(stderr, "failed to create context\n");
return 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

if (!ac) {
printf("failed to create context\n");
fprintf(stderr, "failed to create context\n");
return 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

anthy_resize_segment(ac, nth, rsz);
}
anthy_release_context(ac);
return 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

int ret;
(void)argc;
(void)argv;
ret = 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be also good to replace 0 with EXIT_SUCCESS.

show_stat(db);
save_db(expdata, db);

return 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be also good to replace 0 with EXIT_SUCCESS.

fprintf(stderr, "no input string specified\n");
return EXIT_FAILURE;
}
use_utf8 = 1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is pending.
Since anthy-unicode is designed to use the default encoding UTF-8, I think it would be better to set default_encoding is ANTHY_UTF8_ENCODING in anthy-unicode/src-main/main.c rather than this change .
I don't remember why it's still EUC_JP and need more tests with ibus-anthy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants