Zack Williams | 70a67e7 | 2019-03-08 12:38:51 -0700 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # Makefile for testing and developing XOS |
| 16 | |
| 17 | # set default shell |
| 18 | SHELL = bash -e -o pipefail |
| 19 | |
| 20 | # Variables |
| 21 | XOS_LIBRARIES := $(wildcard lib/*) |
| 22 | XOS_DIR := "." |
| 23 | |
| 24 | venv-xos: |
| 25 | ./scripts/setup_venv.sh |
| 26 | |
| 27 | # tests |
| 28 | test: lib-test xos-test migration-test |
| 29 | |
| 30 | lib-test: |
| 31 | for lib in $(XOS_LIBRARIES); do pushd $$lib; tox; popd; done |
| 32 | |
| 33 | xos-test: venv-xos |
| 34 | source ./venv-xos/bin/activate ; set -u ;\ |
| 35 | nose2 -c tox.ini --verbose --junit-xml |
| 36 | # FIXME: should run `flake8 xos` as a part of this target |
| 37 | |
| 38 | migration-test: venv-xos |
| 39 | source ./venv-xos/bin/activate ; set -u ;\ |
Matteo Scandolo | 8419c08 | 2019-03-11 13:54:44 -0700 | [diff] [blame] | 40 | xos-migrate --xos-dir . -s core --check |
Zack Williams | 70a67e7 | 2019-03-08 12:38:51 -0700 | [diff] [blame] | 41 | |
Scott Baker | 08d1040 | 2019-04-08 16:19:59 -0700 | [diff] [blame^] | 42 | core-xproto-test: venv-xos |
| 43 | source ./venv-xos/bin/activate ; set -u ;\ |
| 44 | xosgenx xos/core/models/core.xproto --lint --strict |
| 45 | |
Zack Williams | 70a67e7 | 2019-03-08 12:38:51 -0700 | [diff] [blame] | 46 | clean: |
| 47 | find . -name '*.pyc' | xargs rm -f |
| 48 | find . -name '__pycache__' | xargs rm -rf |
| 49 | rm -rf \ |
| 50 | .coverage \ |
| 51 | coverage.xml \ |
| 52 | nose2-results.xml \ |
| 53 | venv-xos \ |
| 54 | lib/*/.tox \ |
| 55 | lib/*/build \ |
| 56 | lib/*/dist \ |
| 57 | lib/*/*.egg-info \ |
| 58 | lib/*/.coverage \ |
| 59 | lib/*/coverage.xml \ |
| 60 | lib/*/*results.xml \ |
| 61 | lib/*/*/VERSION \ |
| 62 | lib/xos-genx/xos-genx-tests/out/* \ |
| 63 | lib/xos-util/tests/test_version.py |
| 64 | |