Skip to content

Commit

Permalink
BugFix
Browse files Browse the repository at this point in the history
  • Loading branch information
helviojunior committed Nov 6, 2024
1 parent cd5230a commit 546bbcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 57 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ jobs:
run: |
pytest -s tests/tests.py
- name: Run build test (x86)
run: |
shellcodetester -asm tests/test_x86.asm
- name: Run build test (x86_64)
run: |
shellcodetester -asm tests/test_x86_64.asm
publish:
name: Publish on Test Environment
needs: test
Expand Down
58 changes: 1 addition & 57 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,5 @@

import pytest, sys

from shell_libs.color import Color
from ..shellcodetester import shellcodetester


def test_step_001():
Color.pl('\n\n{+} Compiling x86...{W}')

sys.argv = ['shellcodetester', '-asm', 'test_x86.asm']
if sys.stdout.encoding is None:
# Output is redirected to a file
sys.stdout = codecs.getwriter('latin-1')(sys.stdout)

try:

shellcodetester.run()

assert True
except Exception as e:
Color.pl('\n{!} {R}Error:{O} %s{W}' % str(e))

Color.pl('\n{!} {O}Full stack trace below')
from traceback import format_exc
Color.p('\n{!} ')
err = format_exc().strip()
err = err.replace('\n', '\n{W}{!} {W} ')
err = err.replace(' File', '{W}{D}File')
err = err.replace(' Exception: ', '{R}Exception: {O}')
Color.pl(err)

assert False


def test_step_002():
Color.pl('\n\n{+} Compiling x86_64...{W}')

sys.argv = ['shellcodetester', '-asm', 'test_x86_64.asm']
if sys.stdout.encoding is None:
# Output is redirected to a file
sys.stdout = codecs.getwriter('latin-1')(sys.stdout)

try:

shellcodetester.run()

assert True
except Exception as e:
Color.pl('\n{!} {R}Error:{O} %s{W}' % str(e))

Color.pl('\n{!} {O}Full stack trace below')
from traceback import format_exc
Color.p('\n{!} ')
err = format_exc().strip()
err = err.replace('\n', '\n{W}{!} {W} ')
err = err.replace(' File', '{W}{D}File')
err = err.replace(' Exception: ', '{R}Exception: {O}')
Color.pl(err)

assert False
pass

0 comments on commit 546bbcc

Please sign in to comment.