#!/bin/bash

# Copyright (c) 2011 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.

# Abort on error.
set -e

# Load common constants and variables.
. "$(dirname "$0")/common.sh"

usage() {
    echo "Usage $PROG image"
}

main() {
    if [ $# -ne 1 ]; then
        usage
        exit 1
    fi

    local image="$1"

    local rootfs=$(make_temp_dir)
    mount_image_partition_ro "$image" 3 "$rootfs"

    # This mirrors the check performed in the platform_ToolchainOptions
    # autotest.
    if readelf -s "$rootfs/opt/google/chrome/chrome" | \
       grep -q __asan_init; then
        exit 1
    fi
}
main $@

Add test script that can determine if a build contains ASAN-binaries.
Add test script that can determine if a build contains ASAN-binaries.

BUG=chromium-os:21863
TEST=ensure_not_ASAN.sh image.bin

Change-Id: I414f941a787e0023257401bb8ed7b4a5257f026a
Reviewed-on: http://gerrit.chromium.org/gerrit/10352
Reviewed-by: Gaurav Shah <2987db6a10bcfe664554a372d01e80df7fd325a3@chromium.org>
Tested-by: Jim Hebert <ba29f3d391c58b853c47a49b4da91f3ec0815c1c@chromium.org>
