blob: 7a7c85a5dfa4b0d186f6f065664286558a0ae833 [file] [log] [blame]
Gilad Arnoldab3bb452012-05-22 09:08:12 -07001#!/bin/bash
2
3# Copyright (c) 2012 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 the update engine unit tests, including both userland and run-as-root
8# tests.
9
10if [ ! -e ./update_engine_unittests ]; then
11 echo 'Error: unit test binary missing' >&2
12 exit 1
13fi
14
Gilad Arnold51178712012-07-03 15:52:37 -070015user_pass=0
16./update_engine_unittests --gtest_filter='-*.RunAsRoot*' && user_pass=1
17root_pass=0
18sudo ./update_engine_unittests --gtest_filter='*.RunAsRoot*' && root_pass=1
19
20echo -n "User tests: " && [ $user_pass == 1 ] && echo "PASSED" || echo "FAILED"
21echo -n "Root tests: " && [ $root_pass == 1 ] && echo "PASSED" || echo "FAILED"
Gilad Arnold9f8b93d2012-08-21 11:05:00 -070022
23exit $((2 - user_pass - root_pass))