Skip to content

Commit 0c0062e

Browse files
committed
Merge pull request #104 from zbeekman/make-check-issue-103
Make check issue 103
2 parents 4682c7c + 9ad36c6 commit 0c0062e

File tree

4 files changed

+55
-20
lines changed

4 files changed

+55
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
matrix:
1212
# CMake build with unit tests, no documentation, no coverage analysis
1313
# Allow to fail for now until tests are fixed
14-
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DSKIP_DOC_GEN:BOOL=TRUE -DENABLE_UNICODE:BOOL=TRUE .. && make -j 4 && make test"
14+
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DSKIP_DOC_GEN:BOOL=TRUE -DENABLE_UNICODE:BOOL=TRUE .. && make -j 4 check"
1515
SPECIFIC_DEPENDS="cmake nodejs"
1616
JLINT="yes"
1717
DOCS="no"

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ set ( ENABLE_TESTS TRUE CACHE BOOL
197197
if ( ENABLE_TESTS )
198198
enable_testing()
199199

200+
# emulate GNU Autotools `make check`
201+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
202+
200203
find_program ( JSONLINT jsonlint )
201204
find_program ( DIFF diff )
202205
file ( COPY "${CMAKE_SOURCE_DIR}/files"
@@ -235,8 +238,9 @@ if ( ENABLE_TESTS )
235238
set ( UNIT_TESTS '' )
236239
foreach ( UNIT_TEST ${JF_TEST_SRCS} )
237240
get_filename_component ( TEST ${UNIT_TEST} NAME_WE )
238-
add_executable ( ${TEST} ${UNIT_TEST} )
241+
add_executable ( ${TEST} EXCLUDE_FROM_ALL ${UNIT_TEST} )
239242
target_link_libraries ( ${TEST} ${LIB_NAME} )
243+
add_dependencies ( check ${TEST} )
240244
set_target_properties ( ${TEST}
241245
PROPERTIES
242246
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )

CONTRIBUTING.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22

33
Looking to contribute something to [json-fortran](README.md)? **Here's how you can help.**
44

5+
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
6+
**Table of Contents**
7+
8+
- [Key Branches](#key-branches)
9+
- [Filing issues](#filing-issues)
10+
- [Outstanding Work](#outstanding-work)
11+
- [Pull Requests](#pull-requests)
12+
- [Coding Standards](#coding-standards)
13+
14+
<!-- markdown-toc end -->
15+
516
## Key Branches
617

718
- `master` is the latest, development version and all efforts should be made to keep it stable.
819

20+
[top](#contributing-to-json-fortran)
921
## Filing issues
1022

1123
- Before filing a new [issue](https://github.com/jacobwilliams/json-fortran/issues), please perform a search to see if that issue has already been filed by someone else, and whether or not a solution exists. If you are experiencing the same issue as one that's already posted, please leave any additional comments and information under the existing issue. If your issue is related to a previous issue, but substantively different, file a new issue and include a mention of the related issue in text, using GitHub's `#<issue-number>` syntax.
@@ -16,28 +28,33 @@ Looking to contribute something to [json-fortran](README.md)? **Here's how you c
1628
1. If applicable, what compiler you used, and any non-standard options or configurations that were used.
1729
1. All steps required to reproduce the problem
1830

31+
[top](#contributing-to-json-fortran)
1932
## Outstanding Work
2033

2134
- 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.)
2235

36+
[top](#contributing-to-json-fortran)
2337
## Pull Requests
2438

2539
- Try not to pollute your pull request with unintended changes--keep them simple and small
2640
- Pull requests should address one issue at a time, and each commit should be a set of self contained, related changes. If you forget something in a commit, please use `git rebase -i <ref>^` to amend and/or squash erroneous commits. Here `<ref>` is the reference to to oldest commit needing to be modified (SHA, or `HEAD~4`, etc.)
2741
- Each commit should compile, and ideally pass the tests. Very complicated new features or fixes, may have commits that don't pass tests, if otherwise the commit history would include far to many changes in any given commit. Use an interactive rebase to fix any of these issues, as described above.
28-
- Pull requests should always be based on the upstream master, jacobwilliams/json-fortran:master. Please `rebase` your branch on top of the latest upstream master. Assuming you've added the upstream remote by running something like:
42+
- Pull requests should always be based on the upstream master,
43+
jacobwilliams/json-fortran:master. Please `rebase` your branch on top
44+
of the latest upstream master. Assuming you are on your branch and you've added the upstream remote by running something like:
2945
```
3046
git remote add upstream git://github.com/jacobwilliams/json-fortran.git
3147
```
3248
You can accomplish this by running:
3349
```
34-
git rebase upstream
50+
git rebase upstream/master
3551
```
3652
- Create a branch in your fork with a descriptive name that also includes the [issue number](https://github.com/jacobwilliams/json-fortran/issues), if applicable. For example, after forking the repo, you can run something like `git checkout -b Unicode-support-issue-35` before starting work on [issue #35 : Unicode support](https://github.com/jacobwilliams/json-fortran/issues/35)
3753
- When you're content with your changes, your commits are clean, self contained, with concise descriptive messages, and your changes compile and pass the tests, submit a pull request. We will review your changes, and may ask for certain modifications to be made.
3854
- Pull requests are tested by our [travis-ci](https://travis-ci.org/jacobwilliams/json-fortran) continuous integration system, and any errors uncovered will need to be fixed before the pull request can be merged into master.
3955
- The json-fortran library and associated documentation is released under a BSD style [license](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE). By submitting a pull request, you are agreeing to release your code under the same license. Note that code with GPL or other "copyleft" style licenses will not be accepted.
4056

57+
[top](#contributing-to-json-fortran)
4158
## Coding Standards
4259

4360
- Each commit should address a single logical change and code base transformation.
@@ -48,4 +65,6 @@ git rebase upstream
4865
- *Do NOT* allow your editor to make a bunch of indentation or white space changes, that will introduce non-substantive changes on lines that you have not actually edited.
4966
- The coding style is modern free-form Fortran, consistent with the Fortran 2008 standard. Note that the two supported compilers (ifort and gfortran) do not currently include the entire Fortran 2008 standard. Therefore, only those language features supported by Gfortran 4.9 and Intel 13.1.0 are currently allowed. This also means that previous versions of these compilers are not supported, and major changes to the code to support earlier compilers (or Fortran 95) will not be accepted. At some point in the future (when compiler support has improved), all Fortran 2008 features will be allowed.
5067
- All subroutines and functions *must* be properly documented. This includes useful inline comments as well as comment blocks using the [ROBODoc](http://rfsber.home.xs4all.nl/Robo/manual.html) syntax.
51-
- For simplicity, json-fortran currently consists of one module file. It is not envisioned that it will ever need to expand to include multiple files (if it does, there would need to be a very good reason).
68+
- For simplicity, json-fortran currently consists of one module file. It is not envisioned that it will ever need to expand to include multiple files (if it does, there would need to be a very good reason).
69+
70+
[top](#contributing-to-json-fortran)

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ A Fortran 2008 JSON API
66
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
77
**Table of Contents**
88

9-
- [json-fortran [![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg?style=plastic)](https://github.com/jacobwilliams/json-fortran/releases/latest)](#json-fortran-github-releasehttpsimgshieldsiogithubreleasejacobwilliamsjson-fortransvgstyleplastichttpsgithubcomjacobwilliamsjson-fortranreleaseslatest)
10-
- [Status](#status)
11-
- [Brief description](#brief-description)
12-
- [Download [![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg?style=plastic)](https://github.com/jacobwilliams/json-fortran/releases)](#download-github-releasehttpsimgshieldsiogithubreleasejacobwilliamsjson-fortransvgstyleplastichttpsgithubcomjacobwilliamsjson-fortranreleases)
13-
- [Building the library](#building-the-library)
14-
- [Reading JSON from a file](#reading-json-from-a-file)
15-
- [Reading JSON from a string](#reading-json-from-a-string)
16-
- [Modifying variables in a JSON file](#modifying-variables-in-a-json-file)
17-
- [Writing a JSON file](#writing-a-json-file)
18-
- [Building a JSON file from scratch](#building-a-json-file-from-scratch)
19-
- [Documentation](#documentation)
20-
- [Contributing [![Ready in backlog](https://badge.waffle.io/jacobwilliams/json-fortran.png?label=Ready&title=Ready)](CONTRIBUTING.md)](#contributing-ready-in-backloghttpsbadgewaffleiojacobwilliamsjson-fortranpnglabelreadytitlereadycontributingmd)
21-
- [License](#license)
22-
- [Miscellaneous](#miscellaneous)
9+
- [Status](#status)
10+
- [Brief description](#brief-description)
11+
- [Download](#download-)
12+
- [Building the library](#building-the-library)
13+
- [Reading JSON from a file](#reading-json-from-a-file)
14+
- [Reading JSON from a string](#reading-json-from-a-string)
15+
- [Modifying variables in a JSON file](#modifying-variables-in-a-json-file)
16+
- [Writing a JSON file](#writing-a-json-file)
17+
- [Building a JSON file from scratch](#building-a-json-file-from-scratch)
18+
- [Documentation](#documentation)
19+
- [Contributing](#contributing-)
20+
- [License](#license)
21+
- [Miscellaneous](#miscellaneous)
2322

2423
<!-- markdown-toc end -->
2524

@@ -34,17 +33,20 @@ Status
3433
[![In Progress](https://badge.waffle.io/jacobwilliams/json-fortran.png?label=In%20Progress&title=In%20Progress)](https://waffle.io/jacobwilliams/json-fortran)
3534
[![Needs Review](https://badge.waffle.io/jacobwilliams/json-fortran.png?label=Needs%20Review&title=Needs%20Review)](https://waffle.io/jacobwilliams/json-fortran)
3635

36+
[top](#json-fortran-)
3737
Brief description
3838
---------------
3939

4040
A user-friendly and object-oriented API for reading and writing JSON files, written in
4141
modern Fortran. The source code is a single Fortran module file ([json_module.F90](https://github.com/jacobwilliams/json-fortran/blob/master/src/json_module.F90)).
4242

43+
[top](#json-fortran-)
4344
Download [![GitHub release](https://img.shields.io/github/release/jacobwilliams/json-fortran.svg?style=plastic)](https://github.com/jacobwilliams/json-fortran/releases)
4445
--------------------
4546

4647
Download the official versioned releases [here](https://github.com/jacobwilliams/json-fortran/releases/latest). Or, get the latest development code from the master branch [here](https://github.com/jacobwilliams/json-fortran.git).
4748

49+
[top](#json-fortran-)
4850
Building the library
4951
--------------------
5052

@@ -86,7 +88,7 @@ cmake_minimum_required ( VERSION 2.8.8 FATAL_ERROR )
8688
enable_language ( Fortran )
8789
project ( jf_test NONE )
8890
89-
find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 4.1.0 REQUIRED )
91+
find_package ( jsonfortran-${CMAKE_Fortran_COMPILER_ID} 4.1.1 REQUIRED )
9092
include_directories ( "${jsonfortran_INCLUDE_DIRS}" )
9193
9294
file ( GLOB JF_TEST_SRCS "src/tests/jf_test_*.f90" )
@@ -99,6 +101,7 @@ foreach ( UNIT_TEST ${JF_TEST_SRCS} )
99101
endforeach()
100102
```
101103

104+
[top](#json-fortran-)
102105
Reading JSON from a file
103106
---------------
104107

@@ -140,6 +143,7 @@ for more examples. The source files may be found in `src/tests/`.
140143
end program example1
141144
```
142145

146+
[top](#json-fortran-)
143147
Reading JSON from a string
144148
---------------
145149
JSON can also be read directly from a character string like so:
@@ -159,6 +163,7 @@ After reading a JSON file, if you want to change the values of some of the varia
159163
call json%update('version.patch',0,found) !change patch to 0
160164
```
161165

166+
[top](#json-fortran-)
162167
Writing a JSON file
163168
---------------
164169

@@ -169,6 +174,7 @@ To print the JSON file (either to a file or the console), the `print_file` metho
169174
call json%print_file(iunit) !prints to the file connected to iunit
170175
```
171176

177+
[top](#json-fortran-)
172178
Building a JSON file from scratch
173179
---------------
174180

@@ -244,19 +250,23 @@ The code above produces the file:
244250
}
245251
```
246252

253+
[top](#json-fortran-)
247254
Documentation
248255
--------------
249256

250257
The API documentation for the latest release version can be found [here](http://jacobwilliams.github.io/json-fortran). The documentation can also be generated by processing the source files with [RoboDoc](http://rfsber.home.xs4all.nl/Robo/). Note that both the shell script, CMake, and SCons will also generate these files automatically in the documentation folder, assuming you have RoboDoc installed.
251258

259+
[top](#json-fortran-)
252260
Contributing [![Ready in backlog](https://badge.waffle.io/jacobwilliams/json-fortran.png?label=Ready&title=Ready)](CONTRIBUTING.md)
253261
------------
254262
Want to help? Take a quick look at our [contributing guidelines](CONTRIBUTING.md) then claim something in [the "ready" column on our Waffle.io](https://waffle.io/jacobwilliams/json-fortran) and [Fork. Commit. Pull request.](https://help.github.com/articles/fork-a-repo).
255263

264+
[top](#json-fortran-)
256265
License
257266
--------
258267
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.
259268

269+
[top](#json-fortran-)
260270
Miscellaneous
261271
---------------
262272

@@ -265,3 +275,5 @@ Miscellaneous
265275
* [json-fortran on Travis CI](https://travis-ci.org/jacobwilliams/json-fortran)
266276
* [json-fortran on Waffle.IO](https://waffle.io/jacobwilliams/json-fortran)
267277
* [json-fortran on Coveralls.IO](https://coveralls.io/r/jacobwilliams/json-fortran)
278+
279+
[top](#json-fortran-)

0 commit comments

Comments
 (0)