Skip to content

Commit

Permalink
auto merge of #13288 : alexcrichton/rust/remove-check-fast, r=brson
Browse files Browse the repository at this point in the history
Rebasing of #12304.
  • Loading branch information
bors committed Apr 7, 2014
2 parents 2db9700 + 2ecae80 commit 9a33330
Show file tree
Hide file tree
Showing 329 changed files with 285 additions and 517 deletions.
66 changes: 5 additions & 61 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

# NOTE: Remove after reprogramming windows bots
check-fast: check-lite

.PHONY: cleantmptestlogs cleantestlibs

cleantmptestlogs:
Expand Down Expand Up @@ -875,69 +878,9 @@ $(foreach crate,$(TEST_CRATES), \
$(eval $(call DEF_CHECK_CRATE,$(crate))))

######################################################################
# check-fast rules
# RMAKE rules
######################################################################

FT := run_pass_stage2
FT_LIB := $(call CFG_LIB_NAME_$(CFG_BUILD),$(FT))
FT_DRIVER := $(FT)_driver

GENERATED += tmp/$(FT).rc tmp/$(FT_DRIVER).rs

tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
$(RPASS_TESTS) \
$(S)src/etc/combine-tests.py
@$(call E, check: building combined stage2 test runner)
$(Q)$(CFG_PYTHON) $(S)src/etc/combine-tests.py

define DEF_CHECK_FAST_FOR_T_H
# $(1) unused
# $(2) target triple
# $(3) host triple

$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
tmp/$$(FT).rc \
$$(SREQ2_T_$(2)_H_$(3))
@$$(call E, oxidize: $$@)
$$(STAGE2_T_$(2)_H_$(3)) --crate-type=dylib --out-dir $$(@D) $$< \
-L "$$(RT_OUTPUT_DIR_$(2))"

$(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)): \
tmp/$$(FT_DRIVER).rs \
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB) \
$$(SREQ2_T_$(2)_H_$(3))
@$$(call E, oxidize: $$@ $$<)
$$(STAGE2_T_$(2)_H_$(3)) -o $$@ $$< \
-L "$$(RT_OUTPUT_DIR_$(2))"

$(3)/test/$$(FT_DRIVER)-$(2).out: \
$(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)) \
$$(SREQ2_T_$(2)_H_$(3))
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) \
--logfile tmp/$$(FT_DRIVER)-$(2).log

check-fast-T-$(2)-H-$(3): \
$(3)/test/$$(FT_DRIVER)-$(2).out

endef

$(foreach host,$(CFG_HOST), \
$(eval $(foreach target,$(CFG_TARGET), \
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))

check-fast: tidy check-fast-H-$(CFG_BUILD) \
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate))
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

define DEF_CHECK_FAST_FOR_H

check-fast-H-$(1): check-fast-T-$(1)-H-$(1)

endef

$(foreach host,$(CFG_HOST), \
$(eval $(call DEF_CHECK_FAST_FOR_H,$(host))))

RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)

Expand All @@ -961,6 +904,7 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
@rm -rf $(3)/test/run-make/$$*
@mkdir -p $(3)/test/run-make/$$*
$$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
$$(MAKE) \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
$(3)/test/run-make/$$* \
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \
Expand Down
91 changes: 0 additions & 91 deletions src/etc/combine-tests.py

This file was deleted.

20 changes: 13 additions & 7 deletions src/etc/maketest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@
import os
import sys

os.putenv('RUSTC', os.path.abspath(sys.argv[2]))
os.putenv('TMPDIR', os.path.abspath(sys.argv[3]))
os.putenv('CC', sys.argv[4])
os.putenv('RUSTDOC', os.path.abspath(sys.argv[5]))
filt = sys.argv[6]
ldpath = sys.argv[7]
# FIXME #12303 these tests are broken on windows
if os.name == 'nt':
print 'ignoring make tests on windows'
sys.exit(0)

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]
if ldpath != '':
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])

if not filt in sys.argv[1]:
sys.exit(0)
print('maketest: ' + os.path.basename(os.path.dirname(sys.argv[1])))

proc = subprocess.Popen(['make', '-C', sys.argv[1]],
proc = subprocess.Popen([make, '-C', sys.argv[1]],
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
out, err = proc.communicate()
Expand Down
81 changes: 55 additions & 26 deletions src/libnative/io/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ pub struct Process {

/// None until finish() is called.
exit_code: Option<p::ProcessExit>,

/// Manually delivered signal
exit_signal: Option<int>,
}

impl Process {
Expand Down Expand Up @@ -107,7 +110,12 @@ impl Process {

match res {
Ok(res) => {
Ok((Process { pid: res.pid, handle: res.handle, exit_code: None },
Ok((Process {
pid: res.pid,
handle: res.handle,
exit_code: None,
exit_signal: None,
},
ret_io))
}
Err(e) => Err(e)
Expand All @@ -127,6 +135,14 @@ impl rtio::RtioProcess for Process {
Some(code) => code,
None => {
let code = waitpid(self.pid);
// On windows, waitpid will never return a signal. If a signal
// was successfully delivered to the process, however, we can
// consider it as having died via a signal.
let code = match self.exit_signal {
None => code,
Some(signal) if cfg!(windows) => p::ExitSignal(signal),
Some(..) => code,
};
self.exit_code = Some(code);
code
}
Expand Down Expand Up @@ -157,7 +173,14 @@ impl rtio::RtioProcess for Process {
}),
None => {}
}
return unsafe { killpid(self.pid, signum) };

// A successfully delivered signal that isn't 0 (just a poll for being
// alive) is recorded for windows (see wait())
match unsafe { killpid(self.pid, signum) } {
Ok(()) if signum == 0 => Ok(()),
Ok(()) => { self.exit_signal = Some(signum); Ok(()) }
Err(e) => Err(e),
}
}
}

Expand Down Expand Up @@ -256,31 +279,37 @@ fn spawn_process_os(config: p::ProcessConfig,

let cur_proc = GetCurrentProcess();

let orig_std_in = get_osfhandle(in_fd) as HANDLE;
if orig_std_in == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_in, cur_proc, &mut si.hStdInput,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
if in_fd != -1 {
let orig_std_in = get_osfhandle(in_fd) as HANDLE;
if orig_std_in == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_in, cur_proc, &mut si.hStdInput,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
}
}

let orig_std_out = get_osfhandle(out_fd) as HANDLE;
if orig_std_out == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_out, cur_proc, &mut si.hStdOutput,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
if out_fd != -1 {
let orig_std_out = get_osfhandle(out_fd) as HANDLE;
if orig_std_out == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_out, cur_proc, &mut si.hStdOutput,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
}
}

let orig_std_err = get_osfhandle(err_fd) as HANDLE;
if orig_std_err == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_err, cur_proc, &mut si.hStdError,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
if err_fd != -1 {
let orig_std_err = get_osfhandle(err_fd) as HANDLE;
if orig_std_err == INVALID_HANDLE_VALUE as HANDLE {
fail!("failure in get_osfhandle: {}", os::last_os_error());
}
if DuplicateHandle(cur_proc, orig_std_err, cur_proc, &mut si.hStdError,
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
fail!("failure in DuplicateHandle: {}", os::last_os_error());
}
}

let cmd = make_command_line(config.program, config.args);
Expand All @@ -307,9 +336,9 @@ fn spawn_process_os(config: p::ProcessConfig,
})
});

assert!(CloseHandle(si.hStdInput) != 0);
assert!(CloseHandle(si.hStdOutput) != 0);
assert!(CloseHandle(si.hStdError) != 0);
if in_fd != -1 { assert!(CloseHandle(si.hStdInput) != 0); }
if out_fd != -1 { assert!(CloseHandle(si.hStdOutput) != 0); }
if err_fd != -1 { assert!(CloseHandle(si.hStdError) != 0); }

match create_err {
Some(err) => return Err(err),
Expand Down
1 change: 0 additions & 1 deletion src/test/auxiliary/crateresolve7x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast
// aux-build:crateresolve_calories-1.rs
// aux-build:crateresolve_calories-2.rs

Expand Down
1 change: 0 additions & 1 deletion src/test/auxiliary/issue-2414-b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast

#[crate_id="b#0.1"];
#[crate_type = "lib"];
Expand Down
1 change: 0 additions & 1 deletion src/test/auxiliary/issue-9906.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast windows doesn't like extern crate
// aux-build:issue-9906.rs

pub use other::FooBar;
Expand Down
2 changes: 1 addition & 1 deletion src/test/auxiliary/lang-item-public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[no_std];
#![no_std]

#[lang="fail_"]
fn fail(_: *i8, _: *i8, _: uint) -> ! { loop {} }
Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/ambig_impl_2_exe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast aux-build
// aux-build:ambig_impl_2_lib.rs
extern crate ambig_impl_2_lib;
use ambig_impl_2_lib::me;
Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/asm-in-bad-modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast #[feature] doesn't work with check-fast
#![feature(asm)]

fn foo(x: int) { println!("{}", x); }
Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/asm-misplaced-option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-fast #[feature] doesn't work with check-fast
// ignore-android

#![feature(asm)]
Expand Down
Loading

0 comments on commit 9a33330

Please sign in to comment.