Skip to content

Commit 42f40a6

Browse files
committed
Fix gcov bug and add FORD pages
- automatically merge gcov reports - automatically add FoBiS.py procedure coverage report
1 parent a8f40ae commit 42f40a6

File tree

14 files changed

+727
-43
lines changed

14 files changed

+727
-43
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ bin/
22
lib/
33
builds/
44
doc/
5+
*.gcov
6+
*.gcov.md*
57
*.mod
68
*.o
79
*.obj
@@ -17,4 +19,4 @@ visual_studio_2010/Debug/
1719
visual_studio_2010/Release/
1820
visual_studio_2010/x64
1921
FoBiS.py
20-
robodoc
22+
robodoc

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ env:
3636
cd cmake-build &&
3737
cmake -DCMAKE_BUILD_TYPE=COVERAGE .. &&
3838
make -j 4 check"
39-
CODE_COVERAGE="yes"
4039
4140
# build with build.sh, make documentation, run unit tests and perform coverage analysis
42-
- BUILD_SCRIPT="./build.sh --coverage --enable-unicode"
41+
- >
42+
BUILD_SCRIPT="./build.sh --coverage --skip-documentation &&
43+
./build.sh --coverage --enable-unicode"
4344
CODE_COVERAGE="yes"
4445
4546
install:
@@ -81,7 +82,7 @@ after_success:
8182
- cd $TRAVIS_BUILD_DIR
8283
- |
8384
if [[ $CODE_COVERAGE == [yY]* ]]; then
84-
bash <(curl -s https://codecov.io/bash)
85+
bash <(curl -s https://codecov.io/bash) -f json_fortran.F90.gcov jf_test_*.[fF]90.gcov
8586
fi
8687
- git config --global user.name "TRAVIS-CI-for-$(git --no-pager show -s --format='%cn' $TRAVIS_COMMIT)"
8788
- git config --global user.email "$(git --no-pager show -s --format='%ce' $TRAVIS_COMMIT)"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Looking to contribute something to [json-fortran](README.md)? **Here's how you c
3434
- Take a look at the [issues](https://github.com/jacobwilliams/json-fortran/issues) to see if there is an issue you'd like to help address. [Issues](https://github.com/jacobwilliams/json-fortran/issues) with the [ready label](https://github.com/jacobwilliams/json-fortran/issues?q=is%3Aopen+is%3Aissue+label%3A%22ready%22) or in the [ready column on waffle.io](https://waffle.io/jacobwilliams/json-fortran) are issues that are ready to be dealt with. (i.e., They are not blocked by other dependencies and are higher priority.)
3535
- Increasing the test coverage is another helpful way to
3636
contribute. Please take a look at
37-
[this wiki page](https://github.com/jacobwilliams/json-fortran/wiki/Coverage-Analysis)
37+
[the test coverage page](http://jacobwilliams.github.io/json-fortran/page/development-resources/json_module.F90.gcov.html)
3838
for a list of uncovered procedures, and at the
3939
[Codecov.io suggestions page](https://codecov.io/github/jacobwilliams/json-fortran/features/suggestions)
4040
to find procedures and lines of code that are still uncovered by the

LICENSE

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
JSON-Fortran: A Fortran 2008 JSON API
2-
https://github.com/jacobwilliams/json-fortran
2+
<https://github.com/jacobwilliams/json-fortran>
33

44
Copyright (c) 2014-2015, Jacob Williams
55
All rights reserved.
@@ -14,7 +14,7 @@ are permitted provided that the following conditions are met:
1414
list of conditions and the following disclaimer in the documentation and/or
1515
other materials provided with the distribution.
1616

17-
* The names of its contributors may not be used to endorse or promote products
17+
* The names of its contributors may not be used to endorse or promote products
1818
derived from this software without specific prior written permission.
1919

2020
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -28,26 +28,26 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2828
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2929
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030

31-
!-----------------------------------------------------------------------------------------
32-
!
33-
! Original FSON License:
34-
!
35-
! Copyright (c) 2012 Joseph A. Levin
36-
!
37-
! Permission is hereby granted, free of charge, to any person obtaining a copy of this
38-
! software and associated documentation files (the "Software"), to deal in the Software
39-
! without restriction, including without limitation the rights to use, copy, modify, merge,
40-
! publish, distribute, sublicense, and/or sell copies of the Software, and to permit
41-
! persons to whom the Software is furnished to do so, subject to the following conditions:
42-
!
43-
! The above copyright notice and this permission notice shall be included in all copies or
44-
! substantial portions of the Software.
45-
!
46-
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
47-
! INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
48-
! PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
49-
! LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
50-
! OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
51-
! DEALINGS IN THE SOFTWARE.
52-
!
53-
!-----------------------------------------------------------------------------------------
31+
> -----------------------------------------------------------------------------------------
32+
>
33+
> Original FSON License:
34+
>
35+
> Copyright (c) 2012 Joseph A. Levin
36+
>
37+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this
38+
> software and associated documentation files (the "Software"), to deal in the Software
39+
> without restriction, including without limitation the rights to use, copy, modify, merge,
40+
> publish, distribute, sublicense, and/or sell copies of the Software, and to permit
41+
> persons to whom the Software is furnished to do so, subject to the following conditions:
42+
>
43+
> The above copyright notice and this permission notice shall be included in all copies or
44+
> substantial portions of the Software.
45+
>
46+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
47+
> INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
48+
> PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
49+
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
50+
> OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
51+
> DEALINGS IN THE SOFTWARE.
52+
>
53+
> -----------------------------------------------------------------------------------------

build.sh

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,6 @@ else
280280
echo "Skip building the unit tests since \$JF_SKIP_TESTS has been set to 'true'."
281281
fi
282282

283-
#build the documentation with ford (if present):
284-
echo ""
285-
if [[ $JF_SKIP_DOCS != [yY]* ]]; then
286-
if hash ford 2>/dev/null; then
287-
echo "Building documentation..."
288-
ford $FORDMD
289-
else
290-
echo "FORD not found! Install using: sudo pip install ford"
291-
fi
292-
else
293-
echo "Skip building documentation since \$JF_SKIP_DOCS has been set to ${JF_SKIP_DOCS}."
294-
fi
295-
296283
# Run all the tests unless $JF_SKIP_TESTS
297284
echo ""
298285
if [[ $JF_SKIP_TESTS != [yY]* ]] ; then
@@ -304,9 +291,49 @@ if [[ $JF_SKIP_TESTS != [yY]* ]] ; then
304291
for TEST in jf_test_*; do
305292
# It would be nice to run json output printed to stdout through jsonlint, however,
306293
# some tests output more than one json structure and these need to be split
294+
echo "Running ${TEST}"
307295
./${TEST}
308296
done
297+
cd -
309298
GLOBIGNORE="$OLD_IGNORES"
299+
if [[ $CODE_COVERAGE = [yY]* ]] ; then
300+
[ -f json_module.F90.gcov ] && rm json_module.F90.gcov
301+
gcov -o $LIBDIR ${SRCDIR}${MODCODE}
302+
if [[ $TRY_UNICODE = [yY]* ]] ; then
303+
# gcov/gfortran bug work around
304+
awk -F':' '{line=""; for(i=2;i<=NF;i++){line=line":"$i}; if (NR > 1) print $1 prevline; prevline=line}; END{print " -"prevline}' json_module.F90.gcov > json_module.F90.gcov.fixed && \
305+
mv json_module.F90.gcov{.fixed,}
306+
# rename so we can merge coverage info
307+
mv json_module.F90.gcov json_module-unicode.F90.gcov
308+
else
309+
# rename so we can merge coverage info
310+
mv json_module.F90.gcov json_module-no-unicode.F90.gcov
311+
fi
312+
if [ -f json_module-unicode.F90.gcov ] && [ -f json_module-no-unicode.F90.gcov ]; then
313+
# merge them
314+
./pages/development-resources/gccr.pl -n -c json_module-no-unicode.F90.gcov no-unicode \
315+
json_module-unicode.F90.gcov unicode > json_module.F90.gcov
316+
else
317+
cp json_module-*-unicode.F90.gcov json_module.F90.gcov
318+
fi
319+
FoBiS.py rule -gcov_analyzer .
320+
sed -i"bak" -E 's; \*\*([a-zA-Z]+[a-zA-Z0-9_]*)\*\*; \*\*[[\1]]\*\*;' json_module.F90.gcov.md
321+
sed -i"bak" -E 's;, line ([0-9]+);, line [\1](https://github.com/jacobwilliams/json-fortran/blob/master/src/json_module.F90#L\1);' json_module.F90.gcov.md
322+
gcov -o $BINDIR ${TESTDIR}*.[Ff]90
323+
fi
310324
else
311325
echo "Skip running the unit tests since \$JF_SKIP_TESTS has been set to ${JF_SKIP_TESTS}."
312326
fi
327+
328+
#build the documentation with ford (if present):
329+
echo ""
330+
if [[ $JF_SKIP_DOCS != [yY]* ]]; then
331+
if hash ford 2>/dev/null; then
332+
echo "Building documentation..."
333+
ford $FORDMD
334+
else
335+
echo "FORD not found! Install using: sudo pip install ford"
336+
fi
337+
else
338+
echo "Skip building documentation since \$JF_SKIP_DOCS has been set to ${JF_SKIP_DOCS}."
339+
fi

json-fortran.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
page_dir: pages
12
project: json-fortran
23
favicon: ./media/json-fortran-32x32.png
34
project_dir: ./src
@@ -35,6 +36,13 @@ modern Fortran (Fortran 2003+). The source code is a single Fortran module file
3536

3637
The json-fortran source code and related files and documentation are distributed under a permissive free software license (BSD-style). See the [LICENSE](https://raw.githubusercontent.com/jacobwilliams/json-fortran/master/LICENSE) file for more details.
3738

39+
# Offficial Releases
40+
41+
Browse the documentation for a particular release
42+
[here](|url|releases/index.html) or download the latest official
43+
release
44+
[here](https://github.com/jacobwilliams/json-fortran/releases/tag/4.1.1).
45+
3846
# Miscellaneous
3947

4048
* For more information about JSON, see: <http://www.json.org/>

pages/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: Github README
2+
3+
{!README.md!}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: Contributing Guidelines
2+
3+
{!CONTRIBUTING.md!}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: JSON-Fortran License
2+
3+
{!LICENSE!}

0 commit comments

Comments
 (0)