Skip to content

Conversation

@nancycollins
Copy link
Collaborator

@nancycollins nancycollins commented Dec 12, 2025

renamed the original test to interactive_parse_args_test. it read standard input and prints out the values it gets. there is still a parse_args_test.in text file that can be used as input, or typing from the terminal.

the new parse_args_test uses the fortran-testanything module which prints 'ok' for each test that passes. this version of the test needs no input files.

Description:

made the parse_args_test use the fortran-testanything routines and hardcoded the input inside the test so it can be more easily automated.

Edit Dec 29th 2025:
This pull request also changes parse_args_mod to have ACHAR(92) rather than '\'

Fixes issue

related to moha's #1009 pull request for the ARVOR obs converter. if this test is considered better than the original, then i'll make the csv read test use the same structure.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

Tests

I ran the test program and it failed when I had bad values in the test cases and ran fine when I fixed them.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

renamed the original test to interactive_parse_args_test.  it read standard input
and prints out the values it gets.  there is still a parse_args_test.in text file
that can be used as input, or typing from the termina.

the new parse_args_test uses the fortran-testanything module which prints 'ok'
for each test that passes.  this version of the test needs no input files.
@nancycollins
Copy link
Collaborator Author

i went back and forth on that, but sure. it was useful during development, but i guess at this point both it and the .in file can be removed. i'll do that.

added tests for strings that look like floating point numbers,
and strings with backslash and quoted strings.
Copy link
Member

@hkershaw-brown hkershaw-brown left a comment

Choose a reason for hiding this comment

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

Thanks Nancy, much improved over the test in the repo.
I put a couple of changes for TAP (call plan(# tests) and initialize as standalone). I believe this test program can be run standalone, if not no big deal.

A couple of the test comments don't seem match the code, see comments on these.

Cheers,
Helen

call ok((vals(3) == '3.0'), trim(testnum)//', val 3')
call ok((names(4) == ''), trim(testnum)//', name 4')
call ok((vals(4) == ''), trim(testnum)//', val 4')
call ok((.not. continue_line), trim(testnum)//', continue_line')
Copy link
Member

Choose a reason for hiding this comment

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

You don't have a check for continue_line = .true. ( & ).
Maybe add & to this test

nextline = 'a = 1.0 b = 2.0 c=3.0 &'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good suggestion, fixed.

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Dec 23, 2025
…h in code

address helpful review comments in the test code and avoid the literal
backslash in the module itself by using use ACHAR (like in the test program).
@nancycollins
Copy link
Collaborator Author

i think i've addressed all the helpful review comments.

@hkershaw-brown
Copy link
Member

Note this pull request (will add edit in description) now also has ACHAR(92) in commit 16e3cd9 same commit as review comments) for backslash in parse_args_mod.f90
#1024 (duplicate of #607). The mkmf.templates for the pgi compilers have -Mbackslash as of #557 which I am leaving in to have consistent behavior across compilers.

@hkershaw-brown hkershaw-brown merged commit 3f9b503 into NCAR:main Dec 31, 2025
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release! bundle with next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants