Commit 7f41a51e authored by Michael Davidsaver's avatar Michael Davidsaver

unittests for ProbeToolchain

parent c778f1c3
......@@ -25,23 +25,33 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Builder Info
- name: Prepare
run: |
set -x
which python
python --version
python -m pip install -U pip
python -m pip --version
- name: Test
- name: Deps
shell: bash
run: |
set -x
# capture other deps
pip download -d dist setuptools wheel nose2
python -m pip install -v --no-index -f dist setuptools wheel nose2
python -m nose2 -h
- name: Build/Install
shell: bash
run: |
set -x
python setup.py sdist --formats=gztar
ls dist
# build from source tar to ensure completeness
python -m pip install -v --no-index -f dist setuptools_dso
- name: Test
shell: bash
run: |
set -x
python -m nose2 setuptools_dso
- name: Test Example wheel
shell: bash
run: |
......
......@@ -33,6 +33,6 @@ setup(
python_requires='>=2.7',
install_requires = ['setuptools'],
packages=['setuptools_dso'],
packages=['setuptools_dso', 'setuptools_dso.test'],
package_dir={'':'src'},
)
import unittest
from .. import probe
class TryCompile(unittest.TestCase):
def setUp(self):
self.probe = probe.ProbeToolchain(verbose=True)
def test_try_compile(self):
self.assertTrue(self.probe.try_compile('#include <stdlib.h>'))
self.assertFalse(self.probe.try_compile('intentionally invalid syntax'))
self.assertTrue(self.probe.check_include('stdlib.h'))
self.assertFalse(self.probe.check_include('no-such-header.h'))
self.assertEqual(self.probe.sizeof('short'), 2)
self.assertTrue(self.probe.check_symbol('RAND_MAX', headers=['stdlib.h']))
self.assertTrue(self.probe.check_symbol('abort', headers=['stdlib.h']))
self.assertFalse(self.probe.check_symbol('intentionally_undeclared_symbol', headers=['stdlib.h']))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment