summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-08-04 14:15:46 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-08-06 10:15:23 +0900
commit6ec75569d1cd1039beb327a6359b121aac11b769 (patch)
treef843a469e9f5f97156e93285cf8e4df150d8b351 /Makefile
parent038b5b3fd7db9d080cffb9e190d0e5a051024cdf (diff)
downloadpygerrit-6ec75569d1cd1039beb327a6359b121aac11b769.tar.gz
Add a Makefile to install dependencies and run unit tests
The Makefile installs all necessary dependencies in a virtual environment, and then runs the unit tests. Change-Id: I16c6b68f4c47fab936eb44438c61b7d0bf24b328
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1d52904
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+# The MIT License
+#
+# Copyright 2013 Sony Mobile Communications. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+all: test
+
+test: unittests
+
+unittests: envsetup
+ bash -c "\
+ source ./pygerritenv/bin/activate && \
+ python unittests.py"
+
+envsetup:
+ bash -c "\
+ [ -e ./pygerritenv/bin/activate ] || virtualenv ./pygerritenv && \
+ source ./pygerritenv/bin/activate && \
+ pip install --upgrade -r requirements.txt"