1# Lint as: python2, python3 2# Copyright (c) 2017 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6import logging 7 8from autotest_lib.client.bin import test, utils 9from autotest_lib.client.common_lib import error 10from autotest_lib.client.cros.crash import crash_test 11 12 13class platform_ToolchainTests(test.test): 14 """ 15 Verify the code generated by toolchain on DUTs. 16 """ 17 version = 2 18 19 def run_once(self, rootdir="/", args=[]): 20 """ 21 Run `toolchain-tests`, check the exit status, and print the output. 22 """ 23 24 # Run this, but ignore the crashes it generates 25 with crash_test.FilterOut('fortify-runtime-tests'): 26 result = utils.run('toolchain-tests', ignore_status=True) 27 28 if result.exit_status != 0: 29 logging.error(result.stdout) 30 logging.error(result.stderr) 31 raise error.TestFail('toolchain-tests failed with return code: %d' % 32 result.exit_status) 33 else: 34 logging.debug(result.stdout) 35