[SEBA-449]

Makefile for running all XOS tests, used both by developers and
Jenkins jobs.

Includes llp's "pass over migration" #13204 patchset:

Add ability for core migration to be run/checked from outside of the repo
tree (useful in tests)

Change-Id: I47d027a5492a51273a92296e9da5310b8bc49a8c
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..817a93c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,60 @@
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Makefile for testing and developing XOS
+
+# set default shell
+SHELL = bash -e -o pipefail
+
+# Variables
+XOS_LIBRARIES := $(wildcard lib/*)
+XOS_DIR := "."
+
+venv-xos:
+	./scripts/setup_venv.sh
+
+# tests
+test: lib-test xos-test migration-test
+
+lib-test:
+	for lib in $(XOS_LIBRARIES); do pushd $$lib; tox; popd; done
+
+xos-test: venv-xos
+	source ./venv-xos/bin/activate ; set -u ;\
+	nose2 -c tox.ini --verbose --junit-xml
+	# FIXME: should run `flake8 xos` as a part of this target
+
+migration-test: venv-xos
+	source ./venv-xos/bin/activate ; set -u ;\
+	xos-migrate -x xos -s core --check
+
+clean:
+	find . -name '*.pyc' | xargs rm -f
+	find . -name '__pycache__' | xargs rm -rf
+	rm -rf \
+    .coverage \
+    coverage.xml \
+    nose2-results.xml \
+    venv-xos \
+    lib/*/.tox \
+    lib/*/build \
+    lib/*/dist \
+    lib/*/*.egg-info \
+    lib/*/.coverage \
+    lib/*/coverage.xml \
+    lib/*/*results.xml \
+    lib/*/*/VERSION \
+    lib/xos-genx/xos-genx-tests/out/* \
+    lib/xos-util/tests/test_version.py
+