blob: c1f90320cf7a1eb89d0ee1c6e4a5b963eccf3810 [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 Bakerbe2a5172019-04-10 18:02:50 -070042create-migrations: venv-xos
43 source ./venv-xos/bin/activate ; set -u ;\
44 xos-migrate --xos-dir . -s core -v
45
Scott Baker08d10402019-04-08 16:19:59 -070046core-xproto-test: venv-xos
47 source ./venv-xos/bin/activate ; set -u ;\
48 xosgenx xos/core/models/core.xproto --lint --strict
49
Zack Williams70a67e72019-03-08 12:38:51 -070050clean:
51 find . -name '*.pyc' | xargs rm -f
52 find . -name '__pycache__' | xargs rm -rf
53 rm -rf \
54 .coverage \
55 coverage.xml \
56 nose2-results.xml \
57 venv-xos \
58 lib/*/.tox \
59 lib/*/build \
60 lib/*/dist \
61 lib/*/*.egg-info \
62 lib/*/.coverage \
63 lib/*/coverage.xml \
64 lib/*/*results.xml \
65 lib/*/*/VERSION \
66 lib/xos-genx/xos-genx-tests/out/* \
67 lib/xos-util/tests/test_version.py
68