Skip to content

feat(test): add parsing support for args field in [[test]] manifest#1276

Open
ZainabTravadi wants to merge 1 commit intofortran-lang:mainfrom
ZainabTravadi:feature/test-args-parsing
Open

feat(test): add parsing support for args field in [[test]] manifest#1276
ZainabTravadi wants to merge 1 commit intofortran-lang:mainfrom
ZainabTravadi:feature/test-args-parsing

Conversation

@ZainabTravadi
Copy link
Copy Markdown
Contributor

Summary

This PR adds support for parsing an optional args field in [[test]] entries in fpm.toml.

Example:

[[test]]
name = "example"
args = ["--input", "file.txt"]

The parsed values are stored in test_config_t as an allocatable string array.


Changes

  • Extend test_config_t with args(:)

  • Add get_args helper for parsing and validation

  • Update new_test to parse the args field

  • Update allowlist to accept "args"

  • Add regression tests for:

    • valid args parsing
    • missing args field
    • invalid (non-array) args input

Behavior

  • args is optional
  • If missing → remains unallocated
  • If present → must be an array of strings
  • Invalid types raise a syntax error

Scope

This PR only adds manifest parsing support.

It does not modify:

  • test execution
  • command construction
  • runtime behavior

Execution-level integration can be handled in a follow-up PR.


Motivation

Currently, [[test]] entries do not support passing command-line arguments, limiting flexibility for parameterized tests.

This change introduces a small, backward-compatible improvement aligned with modern build system capabilities.


Testing

Added regression tests in test_manifest.f90:

  • test-args → verifies correct parsing
  • test-args-missing → ensures optional behavior
  • test-args-typeerror → validates error handling

All existing tests pass.


Notes

  • Keeps changes minimal and localized to manifest parsing
  • Follows existing parsing and validation patterns
  • Designed as an incremental step toward more flexible test configuration

Closes #1275

- Extend test_config_t with args(:)
- Parse args from fpm.toml in new_test
- Add validation for array of strings
- Add regression tests for valid, missing, and invalid cases

This change only affects manifest parsing and does not modify execution behavior.
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.

Support parsing of args field in [[test]] manifest configuration

1 participant