Skip to content

Commit 3b65f87

Browse files
zachriggleMathias Svensson
authored andcommitted
Add coveralls.io build steps to .travis.yml (Gallopsled#655)
* Add coveralls.io build steps to .travis.yml Fixes Gallopsled#205 * Fix unit tests which fail under Coveralls * Remove non-coverage "make doctest" * Only report coverage for our code * Add .coveragerc, ignore .coverage, shorten Travis script line * Add Coveralls shield * Fix spacing with badges and logo * Add undocumented command-line tools to increase coverage
1 parent fce5081 commit 3b65f87

File tree

8 files changed

+30
-6
lines changed

8 files changed

+30
-6
lines changed

.coveragerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[run]
2+
branch = True
3+
omit =
4+
*/constants/*
5+
source =
6+
pwn
7+
pwnlib
8+
~/.pwntools-cache/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ MANIFEST
1313
dist
1414
*.egg-info
1515
*.core
16+
.coverage

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ cache:
1313
- /home/travis/virtualenv/python2.7.9/bin/
1414
python:
1515
- "2.7"
16+
after_success:
17+
- coveralls
1618
before_install:
1719
- source .travis_install.sh
1820
- source .travis_ssh_setup.sh
@@ -24,5 +26,5 @@ before_script:
2426
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
2527
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
2628
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
27-
script: PWNLIB_NOTERM=1 make -C docs doctest
28-
29+
script:
30+
- PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# pwntools - CTF toolkit
22
![pwntools logo](docs/source/logo.png?raw=true)
3+
34
[![Docs latest](https://readthedocs.org/projects/pwntools/badge/?version=latest)](https://pwntools.readthedocs.org/)
45
[![Docs 2.2.0](https://readthedocs.org/projects/pwntools/badge/?version=2.2.0)](https://pwntools.readthedocs.org/en/2.2.0)
56
[![PyPI](https://img.shields.io/pypi/v/pwntools.svg?style=flat)](https://pypi.python.org/pypi/pwntools/)
67
[![Gittip](https://img.shields.io/gittip/gallopsled.svg?style=flat)](https://www.gittip.com/gallopsled/)
78
[![Travis](https://travis-ci.org/Gallopsled/pwntools.svg?branch=master)](https://travis-ci.org/pwntools/pwntools)
9+
[![Coveralls](https://img.shields.io/coveralls/Gallopsled/pwntools/master.svg)](https://coveralls.io/github/Gallopsled/pwntools?branch=master)
810
[![Twitter](https://img.shields.io/badge/twitter-pwntools-4099FF.svg?style=flat)](https://twitter.com/pwntools)
911
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
1012

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ tox>=1.8.1
1313
pygments>=2.0
1414
sphinx_rtd_theme
1515
doc2dash
16+
coveralls

docs/source/commandline.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ pwntools comes with a handful of useful command-line utilities which serve as wr
3535
.. autoprogram:: pwnlib.commandline.elfpatch:p
3636
:prog: elfpatch
3737

38+
.. autoprogram:: pwnlib.commandline.errno:parser
39+
:prog: errno
40+
3841
.. autoprogram:: pwnlib.commandline.hex:parser
3942
:prog: hex
4043

4144
.. autoprogram:: pwnlib.commandline.phd:parser
4245
:prog: phd
4346

47+
.. autoprogram:: pwnlib.commandline.pwnstrip:p
48+
:prog: pwnstrip
49+
50+
.. autoprogram:: pwnlib.commandline.scramble:parser
51+
:prog: scramble
52+
4453
.. autoprogram:: pwnlib.commandline.shellcraft:p
4554
:prog: shellcraft
4655

pwnlib/util/misc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def size(n, abbriv = 'B', si = False):
9494
GiB = 1000 * MB
9595

9696
def read(path, count=-1, skip=0):
97-
"""read(path, count=-1, skip=0) -> str
97+
r"""read(path, count=-1, skip=0) -> str
9898
9999
Open file, return content.
100100
101101
Examples:
102-
>>> read('pwnlib/util/misc.py').split('\\n')[0]
103-
'import base64'
102+
>>> read('/proc/self/exe')[:4]
103+
'\x7fELF'
104104
"""
105105
path = os.path.expanduser(os.path.expandvars(path))
106106
with open(path) as fd:

pwnlib/util/proc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def name(pid):
102102
Name of process as listed in ``/proc/<pid>/status``.
103103
104104
Example:
105-
>>> name(os.getpid()) == os.path.basename(sys.argv[0])
105+
>>> pid = pidof('init')[0]
106+
>>> name(pid) == 'init'
106107
True
107108
"""
108109
return psutil.Process(pid).name()

0 commit comments

Comments
 (0)