Testing - mattrighetti/leiserson-retiming GitHub Wiki

Workflow

During the entire project PyTest was used to test correctness of the algorithms contained in this library.

Continuous Integration was setup to ease development and updates release

on:
  push:
    branches: [ development ]
  pull_request:
    branches: [ development ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Test with pytest
      run: |
        pytest

You can checkout passed test here

OPT1 and OPT2 test cases

  1. Generate a random graph with each edge of weight equal to 1.0
  2. Get OPT1 minimum feasible clock on that graph, check that the result is the maximum delay of a node in the graph
  3. Generate a random legal retiming and apply it to the previous graph
  4. Get OPT1 minimum feasible clock on that graph, check that the result is equal to the OPT1 value obtained in step 2 which, by definition, is the minimum