Skip to content
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

Add meson test driver #170

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Add meson test driver #170

merged 1 commit into from
Jun 11, 2024

Conversation

matoro
Copy link
Contributor

@matoro matoro commented May 7, 2024

Switches tests to use "meson test" instead of a shell script. This also means that they now fully respect user-specified toolchain (e.g. clang compiler, custom CFLAGS, etc). Running C++ test is conditional on enabling INIReader support in the build.

 1/16 test_multi                               OK              0.05s
 2/16 test_multi_max_line                      OK              0.04s
 3/16 test_single                              OK              0.04s
 4/16 test_disallow_inline_comments            OK              0.03s
 5/16 test_stop_on_first_error                 OK              0.03s
 6/16 test_handler_lineno                      OK              0.02s
 7/16 test_heap                                OK              0.06s
 8/16 test_string                              OK              0.06s
 9/16 test_heap_max_line                       OK              0.05s
10/16 test_heap_realloc                        OK              0.05s
11/16 test_heap_realloc_max_line               OK              0.05s
12/16 test_heap_string                         OK              0.04s
13/16 test_call_handler_on_new_section         OK              0.04s
14/16 test_allow_no_value                      OK              0.03s
15/16 test_alloc                               OK              0.02s
16/16 test_INIReaderExample                    OK              0.02s

Ok:                 16
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

@benhoyt
Copy link
Owner

benhoyt commented Jun 9, 2024

I appreciate your efforts here. However, I'd rather not require meson as part of the test process of inih, partly because it's a tool I'm not at all familiar with so can't effectively review, and partly because I don't want me or others working on inih to have to install a separate tool (meson) to run the tests.

@benhoyt benhoyt closed this Jun 9, 2024
@matoro
Copy link
Contributor Author

matoro commented Jun 9, 2024

I appreciate your efforts here. However, I'd rather not require meson as part of the test process of inih, partly because it's a tool I'm not at all familiar with so can't effectively review, and partly because I don't want me or others working on inih to have to install a separate tool (meson) to run the tests.

Thank you for looking; would you be interested in accepting if I restored the original shell scripts so that both methods can coexist? Of course they could get out of sync, I understand if you'd rather not due to that concern.

@benhoyt
Copy link
Owner

benhoyt commented Jun 9, 2024

Yes, actually, I'd be willing for them to coexist - good idea.

@benhoyt benhoyt reopened this Jun 9, 2024
@benhoyt
Copy link
Owner

benhoyt commented Jun 9, 2024

I also realised we should run the CI workflow on PR branches - feel free to make that change too.

@benhoyt
Copy link
Owner

benhoyt commented Jun 9, 2024

Oh wait, I guess we do already.

@benhoyt benhoyt changed the title Switch tests to use meson Add meson test driver Jun 10, 2024
.github/workflows/tests.yml Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
runtest.sh Outdated Show resolved Hide resolved
runtest.sh Outdated Show resolved Hide resolved
tests/meson.build Outdated Show resolved Hide resolved
Copy link
Owner

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Nice, this is much cleaner, thanks! One minor suggestion, take it or leave it.

.github/workflows/tests.yml Show resolved Hide resolved
examples/meson.build Outdated Show resolved Hide resolved
meson.build Show resolved Hide resolved
Allows tests to use "meson test" instead of a shell script.  This also
means that they now fully respect user-specified toolchain (e.g. clang
compiler, custom CFLAGS, etc).  Running C++ test is conditional on
enabling INIReader support in the build.

```
 1/16 test_multi                               OK              0.05s
 2/16 test_multi_max_line                      OK              0.04s
 3/16 test_single                              OK              0.04s
 4/16 test_disallow_inline_comments            OK              0.03s
 5/16 test_stop_on_first_error                 OK              0.03s
 6/16 test_handler_lineno                      OK              0.02s
 7/16 test_heap                                OK              0.06s
 8/16 test_string                              OK              0.06s
 9/16 test_heap_max_line                       OK              0.05s
10/16 test_heap_realloc                        OK              0.05s
11/16 test_heap_realloc_max_line               OK              0.05s
12/16 test_heap_string                         OK              0.04s
13/16 test_call_handler_on_new_section         OK              0.04s
14/16 test_allow_no_value                      OK              0.03s
15/16 test_alloc                               OK              0.02s
16/16 test_INIReaderExample                    OK              0.02s

Ok:                 16
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0
```
@benhoyt benhoyt merged commit ed45251 into benhoyt:master Jun 11, 2024
2 checks passed
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