blob: 08a1a6819efeabdb144a077fea0b897f126f7866 [file] [log] [blame]
Andrew Lamb8e70ad02020-03-23 08:40:44 -06001#!/bin/bash -e
2#
3# Copyright 2020 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# Runs python unittests in a venv.
8
9# Move to this script's directory.
10cd "$(dirname "$0")"
11
12# Generate protos
13echo "Generating proto bindings..."
14./generate.sh
15
16# Create and activate venv.
17echo "Creating and activating venv..."
18/usr/bin/python3 -m venv .venv
19source .venv/bin/activate
20
21# Install requirements.
22echo "Installing required packages..."
23pip install -r requirements.txt -q
24
25# Discover and run unittests in payload_utils.
26echo "Running unittests..."
27python3 -m unittest discover -s payload_utils -p "*test.py"
28
29# Deactivate venv.
30deactivate