blob: 58f95741f54024721bc49a63bd9a76e849dbe3c4 [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
28test: lib-test xos-test migration-test
29
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
42clean:
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