1#!/bin/sh
2
3# Copyright 2016 The Fuchsia Authors
4# Copyright (c) 2008 Travis Geiselbrecht
5#
6# Use of this source code is governed by a MIT-style
7# license that can be found in the LICENSE file or at
8# https://opensource.org/licenses/MIT
9
10if [ "$#" -lt 1 ]; then
11    echo "not enough arguments"
12    echo "usage: $0 <project>"
13    exit 1
14fi
15
16case `uname` in
17Linux)
18    N=`cat /proc/cpuinfo | grep processor | wc -l`
19    JOBS=-j$N
20    ;;
21*)
22    JOBS=-j4
23    ;;
24esac
25
26PROJ=$1
27PROJ_DIR=build-${PROJ}
28TESTS="--enable=warning,style,performance,portability,information"
29
30cppcheck --force --file-list=${PROJ_DIR}/srcfiles.txt --includes-file=${PROJ_DIR}/include_paths.txt --include=${PROJ_DIR}/config.h -q --platform=unix32 $TESTS $JOBS
31