blob: 78237575510cd6c8a76f518c9aa38c89834e9763 [file] [log] [blame]
Zack Williams70a67e72019-03-08 12:38:51 -07001# 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
18SHELL = bash -e -o pipefail
19
20# Variables
21XOS_LIBRARIES := $(wildcard lib/*)
22XOS_DIR := "."
23
24venv-xos:
25 ./scripts/setup_venv.sh
26
27# tests
Scott Baker8df749e2019-04-09 10:43:20 -070028test: lib-test xos-test migration-test core-xproto-test
Zack Williams70a67e72019-03-08 12:38:51 -070029
30lib-test:
31 for lib in $(XOS_LIBRARIES); do pushd $$lib; tox; popd; done
32
33xos-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
38migration-test: venv-xos
39 source ./venv-xos/bin/activate ; set -u ;\
Matteo Scandolo8419c082019-03-11 13:54:44 -070040 xos-migrate --xos-dir . -s core --check
Zack Williams70a67e72019-03-08 12:38:51 -070041
Scott Baker08d10402019-04-08 16:19:59 -070042core-xproto-test: venv-xos
43 source ./venv-xos/bin/activate ; set -u ;\
44 xosgenx xos/core/models/core.xproto --lint --strict
45
Zack Williams70a67e72019-03-08 12:38:51 -070046clean:
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