crosvm/tools/presubmit
Dennis Kempin ee56b2ddec Add presubmit script
Consolidates the utility scripts from bin/ into tools/.
Adds a 'presubmit' utility script to run a set of checks and
tests.

This won't be a git hook, but can be manually used to verify
changes before uploading.

BUG=b:199951064
TEST=./tools/presubmit --quick
./tools/dev_container ./tools/presubmit

Change-Id: Iac7c11fca0beaa6d4f214319149ef385fa5ced70
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3225139
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-10-18 20:10:41 +00:00

29 lines
630 B
Bash
Executable file

#!/bin/bash
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
cd "$(dirname $0)/.."
if [[ "$1" == "-q" ]] || [[ "$1" == "--quick" ]]; then
QUICK=true
fi
printf "\n\nRunning clippy...\n"
./tools/clippy
printf "\n\nRunning formatter...\n"
./tools/fmt --check
printf "\n\nRunning x86 tests...\n"
./tools/run_tests --target=host
if [ "$QUICK" = true ] ; then
exit
fi
printf "\n\nRunning aarch64 tests...\n"
./tools/run_tests --target=vm:aarch64
# TODO(b/203152778): Add armhf builds to presubmit