Skip to content
Snippets Groups Projects
Commit efcd8394 authored by Ivar Härnqvist's avatar Ivar Härnqvist
Browse files

fix test setup

parent 38b918fb
No related branches found
No related tags found
3 merge requests!67WIP: B-ASIC version 1.0.0 hotfix,!65B-ASIC version 1.0.0,!15Add changes from sprint 1 and 2 to master
......@@ -28,4 +28,6 @@ $RECYCLE.BIN/
*.stackdump
[Dd]esktop.ini
*.egg-info
__pycache__/
\ No newline at end of file
__pycache__/
env/
venv/
\ No newline at end of file
......@@ -76,13 +76,4 @@ add_custom_target(
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_LIST_DIR}/${LIBRARY_NAME}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIBRARY_NAME}"
COMMENT "Copying python files to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIBRARY_NAME}"
DEPENDS "${TARGET_NAME}" remove_old_python_dir
)
add_custom_target(
copy_misc_files ALL
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/README.md" "${CMAKE_CURRENT_LIST_DIR}/LICENSE" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
COMMENT "Copying misc. files to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
DEPENDS "${TARGET_NAME}"
)
enable_testing()
add_subdirectory(test)
\ No newline at end of file
)
\ No newline at end of file
......@@ -3,7 +3,10 @@
# B-ASIC - Better ASIC Toolbox
B-ASIC is an ASIC toolbox for Python 3 that simplifies circuit design and optimization.
## Prerequisites
## Development
How to build and debug the library during development.
### Prerequisites
The following packages are required in order to build the library:
* cmake 3.8+
* gcc 7+/clang 7+/msvc 16+
......@@ -16,9 +19,6 @@ The following packages are required in order to build the library:
* numpy
* pyside2/pyqt5
## Development
How to build and debug the library during development.
### Using CMake directly
How to build using CMake.
......@@ -64,13 +64,34 @@ The output gets written to `B-ASIC/dist/b-asic-<version>.tar.gz`.
#### Installation (Binary distribution)
In `B-ASIC/dist`:
```
python3 -m pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl
pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl
```
#### Installation (Source distribution)
In `B-ASIC/dist`:
```
python3 -m pip install b-asic-<version>.tar.gz
pip install b-asic-<version>.tar.gz
```
### Running tests
How to run the tests using pytest in a virtual environment.
#### Linux/OS X
In `B-ASIC`:
```
python3 -m venv env
source env/bin/activate
pip install .
pytest
```
#### Windows
In `B-ASIC` (as admin):
```
python3 -m venv env
.\env\Scripts\activate.bat
pip install .
pytest
```
## Usage
......@@ -78,7 +99,7 @@ How to build and use the library as a user.
### Installation
```
python3 -m pip install b_asic
pip install b_asic
```
### Importing
......@@ -88,17 +109,6 @@ python3
>>> help(asic)
```
## Running tests
### pytest
Run all tests against installed version off b_asic using a virtual enviroment
In `B-ASIC`:
```
python3 -m venv .venv
source .venv/bin/activate
pip install .
pytest
```
## License
B-ASIC is distributed under the MIT license.
See the included LICENSE file for more information.
cmake_minimum_required(VERSION 3.13)
project("B-ASIC-test")
add_executable(
test-main
"${CMAKE_CURRENT_SOURCE_DIR}/test_main.cpp"
)
add_test(NAME test-main COMMAND test-main)
\ No newline at end of file
File moved
// TODO: Tests
int main() {
return 0;
}
\ No newline at end of file
from b_asic import InputPort
import b_asic
import pytest
@pytest.fixture
def outp_port():
return InputPort(0)
return b_asic.InputPort(0)
def test_port(outp_port):
assert outp_port.signals() == []
assert outp_port.signals() == []
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment