Reorganize test dir to ensure test of installed pkg
This commit is contained in:
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U -r test/requirements.txt
|
python -m pip install -U -r tests/requirements.txt
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
run: |
|
run: |
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
cd test
|
cd tests
|
||||||
export SKIP_SYNTH_TESTS=1
|
export SKIP_SYNTH_TESTS=1
|
||||||
export STUB_SIMULATOR=1
|
export STUB_SIMULATOR=1
|
||||||
pytest
|
pytest
|
||||||
@@ -59,13 +59,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install -U pylint
|
python -m pip install -U pylint
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
python -m pip install .
|
|
||||||
|
|
||||||
- name: Run Lint
|
- name: Run Lint
|
||||||
run: |
|
run: |
|
||||||
pylint --rcfile test/pylint.rc peakrdl
|
pylint --rcfile tests/pylint.rc src/peakrdl
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
mypy:
|
mypy:
|
||||||
@@ -83,7 +79,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Type Check
|
- name: Type Check
|
||||||
run: |
|
run: |
|
||||||
mypy --config-file test/mypy.ini peakrdl
|
mypy --config-file tests/mypy.ini src/peakrdl
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
build_sdist:
|
build_sdist:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
recursive-include peakrdl/regblock *.sv
|
recursive-include src/peakrdl/regblock *.sv
|
||||||
prune test
|
prune tests
|
||||||
|
|||||||
5
setup.py
5
setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding='utf-8') as fh:
|
|||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
|
|
||||||
with open(os.path.join("peakrdl/regblock", "__about__.py"), encoding='utf-8') as f:
|
with open(os.path.join("src/peakrdl/regblock", "__about__.py"), encoding='utf-8') as f:
|
||||||
v_dict = {}
|
v_dict = {}
|
||||||
exec(f.read(), v_dict)
|
exec(f.read(), v_dict)
|
||||||
version = v_dict['__version__']
|
version = v_dict['__version__']
|
||||||
@@ -19,7 +19,8 @@ setuptools.setup(
|
|||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
url="https://github.com/SystemRDL/PeakRDL-regblock",
|
url="https://github.com/SystemRDL/PeakRDL-regblock",
|
||||||
packages=['peakrdl.regblock'],
|
package_dir={'': 'src'},
|
||||||
|
packages=setuptools.find_namespace_packages("src", include=['peakrdl.*']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
python_requires='>=3.6',
|
python_requires='>=3.6',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
|
|||||||
@@ -47,14 +47,13 @@ Use `pytest --workers auto` to run tests in parallel.
|
|||||||
|
|
||||||
To run all tests:
|
To run all tests:
|
||||||
```bash
|
```bash
|
||||||
cd test/
|
python3 setup.py install
|
||||||
pytest
|
pytest tests
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also run a specific testcase. For example:
|
You can also run a specific testcase. For example:
|
||||||
```bash
|
```bash
|
||||||
cd test/test_hw_access
|
pytest tests/test_hw_access
|
||||||
pytest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ pip install -r $this_dir/requirements.txt
|
|||||||
|
|
||||||
# Install dut
|
# Install dut
|
||||||
cd $this_dir/../
|
cd $this_dir/../
|
||||||
python $this_dir/../setup.py install
|
pip install .
|
||||||
cd $this_dir
|
cd $this_dir
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
@@ -23,7 +23,7 @@ export SKIP_SYNTH_TESTS=1
|
|||||||
pytest --workers auto
|
pytest --workers auto
|
||||||
|
|
||||||
# Run lint
|
# Run lint
|
||||||
pylint --rcfile $this_dir/pylint.rc ../peakrdl
|
pylint --rcfile $this_dir/pylint.rc ../src/peakrdl
|
||||||
|
|
||||||
# Run static type checking
|
# Run static type checking
|
||||||
mypy $this_dir/../peakrdl
|
mypy $this_dir/../src/peakrdl
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user