blob: 5e0520ba094e55795ad70c293fa54a19c1bddbdb [file] [log] [blame]
Illyoung Choi5d59ab62019-06-24 16:15:27 -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# set default shell
16SHELL = bash -e -o pipefail
17
18# Variables
19VERSION ?= $(shell cat ./VERSION)
20
21## Testing related
22CORDWORKFLOWAIRFLOW_LIBRARIES := $(wildcard lib/*)
23
24# Targets
25all: test
26
27# Create a virtualenv and install all the libraries
28venv-workflowengine:
29 virtualenv $@;\
30 source ./$@/bin/activate ; set -u ;\
31 pip install -r requirements.txt nose2 ;\
32 pip install -e lib/cord-workflow-essence-extractor
33
34# tests
35test: lib-test unit-test
36
37lib-test:
38 for lib in $(CORDWORKFLOWAIRFLOW_LIBRARIES); do pushd $$lib; tox; popd; done
39
40unit-test:
41 tox
42
43clean:
44 find . -name '*.pyc' | xargs rm -f
45 find . -name '__pycache__' | xargs rm -rf
46 rm -rf \
47 .coverage \
48 coverage.xml \
49 nose2-results.xml \
50 venv-workflowengine \
51 lib/*/.tox \
52 lib/*/build \
53 lib/*/dist \
54 lib/*/*.egg-info \
55 lib/*/.coverage \
56 lib/*/coverage.xml \
57 lib/*/*results.xml \
58 lib/*/*/VERSION