HACKING 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. Coding Standards
  2. ================
  3. Please try and stick to the GNU coding standards. A lot of hard work
  4. went into making Check compatible with the standards, and would be
  5. nice if that work didn't erode. I decided on the standards because
  6. they work well for a lot of programs much bigger than Check. Ok,
  7. since you're wondering, the advantages of sticking to the standards
  8. are three-fold:
  9. 1) consistent style within the project
  10. 2) being familiar with the standards lets you work on lots of
  11. different GNU standards-compliant projects pretty easily
  12. 3) it reduces the number of decisions that must be made
  13. Doxygen Reference for Development
  14. ================
  15. You can use `doc/doxygen-devel` target to generate a verbose doxygen reference.
  16. Resulting documentation will be placed into `doc/doxygen-devel`. This option
  17. needs graphviz installed to render call graphs. If graphviz is not found they
  18. won't be rendered.
  19. Release Process
  20. ===============
  21. To create a release one will need to be a member of the libcheck organization
  22. on GitHub. If you are not a member, a current member can add you
  23. by going to:
  24. https://github.com/orgs/libcheck/people
  25. and submitting an invite.
  26. 1) To create a release, start in a configured in-place
  27. checkout of the Check project:
  28. $ git clone https://github.com/libcheck/check.git
  29. $ cd check
  30. 2) Determine the version of Check to release, and update
  31. the configure.ac script:
  32. AC_INIT([Check], [0.10.1], [check-devel at lists dot sourceforge dot net])
  33. CHECK_MAJOR_VERSION=0
  34. CHECK_MINOR_VERSION=10
  35. CHECK_MICRO_VERSION=1
  36. (Remember to update both the AC_INIT line and each of the CHECK_*_VERSION fields).
  37. 3) Update the header in the NEWS file to mention the release:
  38. Sun Aug 2, 2015: Released Check 0.10.1
  39. 2015-08-02 19:21:14 +0000
  40. based on hash f399542eeceb97703bca496b68bb39044e8baa01
  41. 4) Update index.html mentioning the release. Look for the following:
  42. <!-- Update this section during a release -->
  43. 5) Attempt to build the release locally
  44. $ autoreconf -i
  45. $ ./configure
  46. $ make distcheck
  47. If this passes, a tarball with the current release number will be in the current
  48. directory. Make note of this, as it will be uploaded to GitHub later.
  49. 6) Commit the changes to configure.ac, NEWS, and index.html to the Check project's
  50. master branch, with the commit message:
  51. "Update for release"
  52. 7) Log On to GitHub and navigate to:
  53. https://github.com/libcheck/check/releases
  54. Click "Draft a New Release".
  55. Enter the release version to the Tag Version box, and enter the
  56. git hash into the Target selector.
  57. Fill in the Release Title field.
  58. Describe the release with something similar to the following:
  59. =====
  60. <some sentence about the release, e.g. "This is a bug fix release.">
  61. Please test it out and report any problems you might have.
  62. Changes:
  63. <paste contents of NEWS here for the release>
  64. =====
  65. Attach the tarball for the release, then publish the release.
  66. 8) Use the following template to announce the release via email:
  67. =====
  68. Subject: check-X.Y.Z released
  69. Hi,
  70. <some sentence about the release, e.g. "This is a bug fix release.">
  71. Please test it out and report any problems you might have.
  72. https://github.com/libcheck/check/releases
  73. Thanks,
  74. `whoami`
  75. <paste contents of NEWS for the release here>
  76. =====
  77. 9) Update the development header in the NEWS file and commit the result.
  78. 10) Push updated website (see section below)
  79. Congratulations, you are done!
  80. Update website
  81. ==============
  82. The Check website is automatically hosted from the contents of
  83. the gh-pages branch in the Check git repository. To update
  84. the website, merge the contents of the master branch into
  85. the gh-pages branch.
  86. To update the generated documentation for the website:
  87. $ git remote -v
  88. github https://github.com/libcheck/check.git (fetch)
  89. github https://github.com/libcheck/check.git (push)
  90. $ git fetch github
  91. $ git checkout github/gh-pages -b gh-pages
  92. Branch gh-pages set up to track remote branch gh-pages from github.
  93. Switched to a new branch 'gh-pages'
  94. $ git merge github/master
  95. First, rewinding head to replay your work on top of it...
  96. Fast-forwarded gh-pages to github/master.
  97. $ autoreconf -i
  98. $ ./configure
  99. $ make clean
  100. $ make
  101. $ make doc/check_html
  102. $ make doc/doxygen
  103. $ git add doc
  104. $ git commit -m “Update documentation”
  105. $ git push github gh-pages:gh-pages
  106. Automatic building of pull requests
  107. ===============
  108. The GitHub project is configured to build requests automatically.
  109. This is done using GitHub Actions and AppVeyor. GitHub Actions is
  110. configured to build and test against Linux, macOS, and Windows, using
  111. the configurations under:
  112. .github/workflows
  113. AppVeyor builds and tests Check for Windows, using the configuration
  114. in appveyor.yml. These are started automatically on pull requests,
  115. and the results are reported in the pull request when finished.
  116. Using gcov
  117. ===============
  118. The gcov tool can be used to determine the unit test coverage in Check
  119. itself. This is currently supported on GNU/Linux only. To enable the
  120. necessary build time flags, add the following argument to the
  121. configure script:
  122. --enable-gcov
  123. Once the unit tests have been run with
  124. $ make check
  125. assuming the terminal is in the top src directory, the following will
  126. generate summary information using gcov:
  127. $ cp src/*.c src/.libs/
  128. $ cd src/.libs
  129. $ for file in `ls *.c`; do
  130. gcov -f $file > $file.gcov.summary.txt
  131. mv $file.gcov $file.gcov.txt
  132. done
  133. The *.gcov.txt files will contain the source code annotated with
  134. the number of times each line was executed. The .*gcov.summary.txt
  135. files will contain a line execution summary per function.
  136. To determine the line execution summary for all of Check, either
  137. the gcovr tool can be used, or the following quick-and-dirty script:
  138. $ for file in ls *.summary.txt; do cat $file; done \
  139. | grep "Lines executed" | cut -d ":" -f 2 | tr -d "%" \
  140. | awk '{checked+=$1*$3/100; total+=$3} END {print checked/total*100}'