Files
OpenCellular/common/test_util.c
Vic Yang e71f008388 Put test utility macros in header
Several test utility macros have been duplicated across tests. Let's put
them in a single place.

BUG=chrome-os-partner:19236
TEST='make runtests', 'BOARD=spring make tests'
BRANCH=None

Change-Id: Ib0c9f829715425cc23e33b8ef456b17dfadab13c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50513
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-05-08 18:11:01 -07:00

37 lines
743 B
C

/* Copyright (c) 2013 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.
*
* Test utilities.
*/
#include "console.h"
#include "test_util.h"
#include "util.h"
int __test_error_count;
/* Weak reference function as an entry point for unit test */
test_mockable void run_test(void) { }
void test_reset(void)
{
__test_error_count = 0;
}
void test_print_result(void)
{
if (__test_error_count)
ccprintf("Fail! (%d tests)\n", __test_error_count);
else
ccprintf("Pass!\n");
}
static int command_run_test(int argc, char **argv)
{
run_test();
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(runtest, command_run_test,
NULL, NULL, NULL);