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

test the stand alone programs listed in the README.md #67

Closed
zbeekman opened this issue Feb 28, 2015 · 5 comments · Fixed by #71
Closed

test the stand alone programs listed in the README.md #67

zbeekman opened this issue Feb 28, 2015 · 5 comments · Fixed by #71

Comments

@zbeekman
Copy link
Contributor

I’m thinking of adding a few lines to build.sh that will pull out an fortran program source listings in the README.md and dump them into src/tests/jf_test_<program_name>.f90 to get compiled and run with the other unit tests. This would mean that the full programs listed in the README.md could be tested to ensure that they at least compile and run, without having to maintain duplicate copies of the source code. If they get moved to a wiki, as suggested in #66, however, I think we will lose the ability to do this. Thoughts?

@jacobwilliams
Copy link
Owner

It's an interesting idea. I wonder if it might be more trouble than it's worth, though.

@zbeekman
Copy link
Contributor Author

maybe... but it would simultaneously increase test coverage... should just be one or two lines of sed or awk.

@jacobwilliams
Copy link
Owner

Could we have a specific keyword or comment flag in the code that we would use to indicate that we want this behavior? (or better yet, a comment in the .md file... can we have non-printing comments in .md files?) That way, some of the examples could be code snippets (like we have now), and we aren't restricted to having every example be a compilable program.

Also: I think we could do it with the wiki maybe... it could just clone https://github.com/jacobwilliams/json-fortran.wiki.git and then process all the .md files that are there.

@zbeekman
Copy link
Contributor Author

zbeekman commented Mar 1, 2015

I have a good, easy working example…. and yea, that’s not a bad idea about cloning the wiki.

As far as I know there is no way to put comments in the README.md file that don’t get printed—but never fear! Right now it will only attempt to extract full “program” units, and just skip over all other code. To make my life easy, I just fetch http://people.sc.fsu.edu/~jburkardt/f_src/extract/extract.f90 and compile it on travis, and use it to extract any full programs in the README.md, so I don’t have to mess around with awk or sed. So for the README.md it just extracts example1 and example2, and skips over all the other embedded code.

zbeekman added a commit to zbeekman/json-fortran that referenced this issue Mar 1, 2015
 - Fixes jacobwilliams#67 compile and test example code from README.md
 - Small bug fix to dynamically computing the number of digits for real format edit descriptors
   - ceiling( log10( ... --> floor( 1 + log10( ...
   - consider the case when the number in question is a power of 10 e.g. 100 has 3 digits
zbeekman added a commit to zbeekman/json-fortran that referenced this issue Mar 1, 2015
 - Fixes jacobwilliams#67 compile and test example code from README.md
 - Small bug fix to dynamically computing the number of digits for real format edit descriptors
   - ceiling( log10( ... --> floor( 1 + log10( ...
   - consider the case when the number in question is a power of 10 e.g. 100 has 3 digits
zbeekman added a commit to zbeekman/json-fortran that referenced this issue Mar 1, 2015
 - Fixes jacobwilliams#67 compile and test example code from README.md
 - Small bug fix to dynamically computing the number of digits for real format edit descriptors
   - ceiling( log10( ... --> floor( 1 + log10( ...
   - consider the case when the number in question is a power of 10 e.g. 100 has 3 digits
zbeekman added a commit to zbeekman/json-fortran that referenced this issue Mar 1, 2015
 - Fixes jacobwilliams#67 compile and test example code from README.md
 - Small bug fix to dynamically computing the number of digits for real format edit descriptors
   - ceiling( log10( ... --> floor( 1 + log10( ...
   - consider the case when the number in question is a power of 10 e.g. 100 has 3 digits
@jacobwilliams
Copy link
Owner

Genius!

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 a pull request may close this issue.

2 participants