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