Skip to content

Commit

Permalink
Add windows tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gogo2464 committed Jun 2, 2022
1 parent da144ac commit cf51de7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/windows.yml
@@ -0,0 +1,24 @@
name: Windows Tests
on: [push, pull_request]

jobs:
test:
strategy:
matrix:
os:
- windows
runs-on:
- windows-latest
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
choco install pandoc
choco install sphinx
choco install make
pip install --upgrade pip --user
pip install doctest --user
python setup.py install --user
- name: run tests
run: |
make -C docs win-doctest
2 changes: 2 additions & 0 deletions docs/Makefile
Expand Up @@ -163,3 +163,5 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
win-doctest:
@python -m doctest -v D:/a/pwntools/pwntools/pwnlib/tubes/process.py
8 changes: 8 additions & 0 deletions pwnlib/tubes/process.py
Expand Up @@ -117,6 +117,14 @@ class process(tube):
Examples:
>>> if sys.platform.startswith('win'):
... context.os = "windows"
... p = process(b"C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe")
... p.recvuntil(b".")
... else:
... b'Windows PowerShell \r\nCopyright (C) Microsoft Corporation.'
b'Windows PowerShell \r\nCopyright (C) Microsoft Corporation.'
>>> p = process('python')
>>> p.sendline(b"print('Hello world')")
>>> p.sendline(b"print('Wow, such data')")
Expand Down

0 comments on commit cf51de7

Please sign in to comment.