Skip to content

Commit

Permalink
Added .travis.yml (pwndbg#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsingh93 authored and zachriggle committed Jun 10, 2016
1 parent b987b41 commit 269b47f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sudo: required
dist: trusty
language: python
install:
- sudo apt-get -y install gdb
- lsb_release -a
- pip install -r requirements.txt
- sudo ./setup.sh
script: nosetests ./tests/
Empty file added tests/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions tests/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import subprocess
import tempfile
import unittest

def pywrite(data):
return write(data, suffix='.py')

def write(data, suffix=''):
t = tempfile.NamedTemporaryFile(delete=False, suffix=suffix)
t.write(data.encode('utf-8'))
return t

def run_gdb_with_script(pybefore='', pyafter=''):
command = ['gdb','--silent','--nx','--nh']

if pybefore:
command += ['--command', pywrite(pybefore).name]

command += ['--command', 'gdbinit.py']

if pyafter:
command += ['--command', pywrite(pyafter).name]

command += ['--eval-command', 'quit']

return subprocess.check_output(command, stderr=subprocess.STDOUT)
5 changes: 5 additions & 0 deletions tests/testLoadsWithoutCrashing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import common

def test_loads_wivout_crashing_bruv():
output = common.run_gdb_with_script()
assert 'Type pwndbg for a list' in output, output

0 comments on commit 269b47f

Please sign in to comment.