Clean up psyclone test file
Running the full test suite results in a psyclone test file (tests/system_tests/psyclone/algorithm.parsable_x90). When running interactively, this makes it appear as thought the repository has outstanding changes.
This file should be cleaned up when the test is complete. It may also be worth adding it to the .gitignore file for the repository.
Yeah, that is annoying. I had a look in the past:
pytest -s -k test_analyse ./test_psyclone_system_test.py
creates the file. And just changing into tmpdir doesn't help.
The test should probably grab_folder (so all source files are copied into tmpdir/proj/source), then the parsable file will be created in tmp_dir.
But, I wonder if this isn't actually a kind of bug: shouldn't the parsable version be created in build_output, and not next to the original source file? Similar to the way the pre-processed files are not created 'next' to the source file.
Actually, it raises a question I had for some time (I always wanted to dig into this, just never found the time): why on earth is this parseable step done in the first place? Looking at the Fortran 2023 standard, the grammar itself DOES allow name keywords anywhere, e.g. call mysub(a=3, 4) is valid according to the grammar, it's only a semantic rule afterwards that makes this invalid:
C1531 (R1523) The keyword = shall not be omitted from an actual-arg-spec unless it has been omitted from 32 each preceding actual-arg-spec in the argument list.
Consequently, fparser2 DOES accept an invoke statement even if the name is at the beginning (after all, this is how PSyclone parses the files). E.g. (using algorithm.x90 from the above example):
parser2 algorithm.x90 | grep invoke
File: 'algorithm.x90'
CALL invoke(name = "name a", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(name = "name b", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(name = "name c", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(name = "name d", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(name = "name e", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(name = "name f", kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
CALL invoke(kernel_one_type(a, b), kernel_two_type(a, b), built_in())
So you can see the output of fparser2 has the leading name= style.
@MatthewHambley , do you remember the reasons for adding this? Should I open a ticket so we can check if this whole step can be removed?
I've marked this as sub-issue of #469 (which is the proper solution), and removed good-first-issue (which it is not anymore since it involves reasonable large modifications of the PSyclone step), and also it's not really a test-suite issue, since it affects any usage of Fab.