Automatically generate demo test suite from JSON file - #92
Merged
Conversation
This commit converts the following string_t procedures from being declared pure to being declared elemental: - base_name - get_real - get_real_with_character_key - get_double_precision - get_double_precision_with_character_key - get_string_with_character_key - get_integer_with_character_key - get_integer - get_logical_with_character_key - string_t_cat_character - character_cat_string_t
This commit 1. Shrinks the JSON file to just a list of test subjects. 2. Rewrites the scaffolding app to create a driver based on a. test type names formed by appending '_test_t' to subject names b. test module names formed by appending '_m' to subject names. 3. Relocates the file 'test-suite.json' to demo/ and uses that file to generate 'demo/test/driver.f90'.
This commit disaggregates pull requests 92 and 93 to ensure that 92 builds independently of the compiler_t derived type that 93 adds.
With this commit, the command below, when executed outside the demo/test subdirectory, prompts the app/scaffold.F90 program to 1. Read a JSON file containing an array of test-subject names and 2. Create a demonstration test suite in the demo/test subdirectory. fpm run scaffold \ --compiler flang-new \ -- --json-file demo/test-suite.json \ --suite-path demo/test whereupon running the command below while inside the demo subdirectory will run the created test suite, demonstrating one one passing test and one failing test: fpm test --compiler flang-new At present, the `fpm run scaffold` command works with the LLVM flang (flang-new) compiler but not with the GCC (gfortran) or NAG (nagfor) compilers. The second fpm command works with either compiler.
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
This commit converts the following string_t procedures from being declared pure to being declared elemental: - base_name - get_real - get_real_with_character_key - get_double_precision - get_double_precision_with_character_key - get_string_with_character_key - get_integer_with_character_key - get_integer - get_logical_with_character_key - string_t_cat_character - character_cat_string_t
This commit 1. Switches to the older form of the test-suite driver program when the GCC version is less than 14.3. This prevents a test failure in GitHub CI, where the GCC version is currently 14.2. 2. Skips one string_t test with GCC.
This commit makes the specific string_t binding get_integer_array public when compiling with gfortran to work around a seg fault that occurs when this procedure is invoked through the get_json_value generic binding. The corresponding unit test is adjusted to use the specific binding until a minimal reproducer can be developed and reported, at which point it could make sense to instead skip the test as a way to document and expose the issue in the test output.
rouson
force-pushed
the
auto-generate-driver
branch
from
August 16, 2025 05:08
aff53f4 to
97e77c4
Compare
This commit reverts several specific procedures from elemental to non-elemental pure. The relevant functions extract values from JSON key/value pairs. Making these functions elemental causes an apparent ambiguity with the corresponding versions of these functions that extract array values from JSON key/value pairs. Four compilers tested accept the code, but gfortran disambiguates the call differently, causing a crash. This commit eliminates the crash.
This commit overhauls the demonstration project documentation, including the demo/README.md and the UML class diagram, for the new test-suite driver structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Given a JSON file that lists a set of test subjects, the new program in
app/scaffold.F90added by this PR generates the a stub test suite that has been committed in thedemo/testsubdirectory. The Generating test scaffolding section of thedemo/README.mdfile shows the JSON file format and describes how to generate and run the demonstration test suite.