2014-02-02 04:47:02 -06:00
|
|
|
# Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
2013-11-16 19:07:32 -06:00
|
|
|
|
|
|
|
import subprocess
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2014-02-14 21:21:17 -06:00
|
|
|
# FIXME #12303 these tests are broken on windows
|
|
|
|
if os.name == 'nt':
|
|
|
|
print 'ignoring make tests on windows'
|
|
|
|
sys.exit(0)
|
|
|
|
|
2014-02-26 22:13:08 -06:00
|
|
|
make = sys.argv[2]
|
|
|
|
os.putenv('RUSTC', os.path.abspath(sys.argv[3]))
|
|
|
|
os.putenv('TMPDIR', os.path.abspath(sys.argv[4]))
|
|
|
|
os.putenv('CC', sys.argv[5])
|
|
|
|
os.putenv('RUSTDOC', os.path.abspath(sys.argv[6]))
|
|
|
|
filt = sys.argv[7]
|
|
|
|
ldpath = sys.argv[8]
|
2014-02-21 18:32:49 -06:00
|
|
|
if ldpath != '':
|
|
|
|
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])
|
2014-01-03 13:16:52 -06:00
|
|
|
|
|
|
|
if not filt in sys.argv[1]:
|
|
|
|
sys.exit(0)
|
|
|
|
print('maketest: ' + os.path.basename(os.path.dirname(sys.argv[1])))
|
2013-11-16 19:07:32 -06:00
|
|
|
|
2014-02-26 22:13:08 -06:00
|
|
|
proc = subprocess.Popen([make, '-C', sys.argv[1]],
|
2013-11-16 19:07:32 -06:00
|
|
|
stdout = subprocess.PIPE,
|
|
|
|
stderr = subprocess.PIPE)
|
|
|
|
out, err = proc.communicate()
|
|
|
|
i = proc.wait()
|
|
|
|
|
|
|
|
if i != 0:
|
|
|
|
|
|
|
|
print '----- ' + sys.argv[1] + """ --------------------
|
|
|
|
------ stdout ---------------------------------------------
|
|
|
|
""" + out + """
|
|
|
|
------ stderr ---------------------------------------------
|
|
|
|
""" + err + """
|
|
|
|
------ ---------------------------------------------
|
|
|
|
"""
|
|
|
|
sys.exit(i)
|
|
|
|
|