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 | |
| 42 | clean: |
| 43 | find . -name '*.pyc' | xargs rm -f |
| 44 | find . -name '__pycache__' | xargs rm -rf |
| 45 | rm -rf \ |
| 46 | .coverage \ |
| 47 | coverage.xml \ |
| 48 | nose2-results.xml \ |
| 49 | venv-xos \ |
| 50 | lib/*/.tox \ |
| 51 | lib/*/build \ |
| 52 | lib/*/dist \ |
| 53 | lib/*/*.egg-info \ |
| 54 | lib/*/.coverage \ |
| 55 | lib/*/coverage.xml \ |
| 56 | lib/*/*results.xml \ |
| 57 | lib/*/*/VERSION \ |
| 58 | lib/xos-genx/xos-genx-tests/out/* \ |
| 59 | lib/xos-util/tests/test_version.py |
| 60 | |