Permalink
Browse files

Add coveralls.io build steps to .travis.yml (#655)

* Add coveralls.io build steps to .travis.yml

Fixes Gallopsled/pwntools#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
  • Loading branch information...
zachriggle authored and Idolf committed Aug 18, 2016
1 parent fce5081 commit 3b65f8775a046cc1db1eacd8f701cb36853fd951
Showing with 30 additions and 6 deletions.
  1. +8 −0 .coveragerc
  2. +1 −0 .gitignore
  3. +4 −2 .travis.yml
  4. +2 −0 README.md
  5. +1 −0 docs/requirements.txt
  6. +9 −0 docs/source/commandline.rst
  7. +3 −3 pwnlib/util/misc.py
  8. +2 −1 pwnlib/util/proc.py
View
@@ -0,0 +1,8 @@
[run]
branch = True
omit =
*/constants/*
source =
pwn
pwnlib
~/.pwntools-cache/
View
@@ -13,3 +13,4 @@ MANIFEST
dist
*.egg-info
*.core
.coverage
View
@@ -13,6 +13,8 @@ cache:
- /home/travis/virtualenv/python2.7.9/bin/
python:
- "2.7"
after_success:
- coveralls
before_install:
- source .travis_install.sh
- source .travis_ssh_setup.sh
@@ -24,5 +26,5 @@ before_script:
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
- PWNLIB_NOTERM=1 python -c 'from pwn import *; print pwnlib.term.term_mode'
script: PWNLIB_NOTERM=1 make -C docs doctest
script:
- PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest
View
@@ -1,10 +1,12 @@
# pwntools - CTF toolkit
![pwntools logo](docs/source/logo.png?raw=true)
[![Docs latest](https://readthedocs.org/projects/pwntools/badge/?version=latest)](https://pwntools.readthedocs.org/)
[![Docs 2.2.0](https://readthedocs.org/projects/pwntools/badge/?version=2.2.0)](https://pwntools.readthedocs.org/en/2.2.0)
[![PyPI](https://img.shields.io/pypi/v/pwntools.svg?style=flat)](https://pypi.python.org/pypi/pwntools/)
[![Gittip](https://img.shields.io/gittip/gallopsled.svg?style=flat)](https://www.gittip.com/gallopsled/)
[![Travis](https://travis-ci.org/Gallopsled/pwntools.svg?branch=master)](https://travis-ci.org/pwntools/pwntools)
[![Coveralls](https://img.shields.io/coveralls/Gallopsled/pwntools/master.svg)](https://coveralls.io/github/Gallopsled/pwntools?branch=master)
[![Twitter](https://img.shields.io/badge/twitter-pwntools-4099FF.svg?style=flat)](https://twitter.com/pwntools)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
View
@@ -13,3 +13,4 @@ tox>=1.8.1
pygments>=2.0
sphinx_rtd_theme
doc2dash
coveralls
@@ -35,12 +35,21 @@ pwntools comes with a handful of useful command-line utilities which serve as wr
.. autoprogram:: pwnlib.commandline.elfpatch:p
:prog: elfpatch
.. autoprogram:: pwnlib.commandline.errno:parser
:prog: errno
.. autoprogram:: pwnlib.commandline.hex:parser
:prog: hex
.. autoprogram:: pwnlib.commandline.phd:parser
:prog: phd
.. autoprogram:: pwnlib.commandline.pwnstrip:p
:prog: pwnstrip
.. autoprogram:: pwnlib.commandline.scramble:parser
:prog: scramble
.. autoprogram:: pwnlib.commandline.shellcraft:p
:prog: shellcraft
View
@@ -94,13 +94,13 @@ def size(n, abbriv = 'B', si = False):
GiB = 1000 * MB
def read(path, count=-1, skip=0):
"""read(path, count=-1, skip=0) -> str
r"""read(path, count=-1, skip=0) -> str
Open file, return content.
Examples:
>>> read('pwnlib/util/misc.py').split('\\n')[0]
'import base64'
>>> read('/proc/self/exe')[:4]
'\x7fELF'
"""
path = os.path.expanduser(os.path.expandvars(path))
with open(path) as fd:
View
@@ -102,7 +102,8 @@ def name(pid):
Name of process as listed in ``/proc/<pid>/status``.
Example:
>>> name(os.getpid()) == os.path.basename(sys.argv[0])
>>> pid = pidof('init')[0]
>>> name(pid) == 'init'
True
"""
return psutil.Process(pid).name()

0 comments on commit 3b65f87

Please sign in to comment.