Skip to content

Commit 9a33330

Browse files
committed
auto merge of #13288 : alexcrichton/rust/remove-check-fast, r=brson
Rebasing of #12304.
2 parents 2db9700 + 2ecae80 commit 9a33330

File tree

329 files changed

+285
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+285
-517
lines changed

mk/tests.mk

+5-61
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
183183
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
184184
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
185185

186+
# NOTE: Remove after reprogramming windows bots
187+
check-fast: check-lite
188+
186189
.PHONY: cleantmptestlogs cleantestlibs
187190

188191
cleantmptestlogs:
@@ -875,69 +878,9 @@ $(foreach crate,$(TEST_CRATES), \
875878
$(eval $(call DEF_CHECK_CRATE,$(crate))))
876879

877880
######################################################################
878-
# check-fast rules
881+
# RMAKE rules
879882
######################################################################
880883

881-
FT := run_pass_stage2
882-
FT_LIB := $(call CFG_LIB_NAME_$(CFG_BUILD),$(FT))
883-
FT_DRIVER := $(FT)_driver
884-
885-
GENERATED += tmp/$(FT).rc tmp/$(FT_DRIVER).rs
886-
887-
tmp/$(FT).rc tmp/$(FT_DRIVER).rs: \
888-
$(RPASS_TESTS) \
889-
$(S)src/etc/combine-tests.py
890-
@$(call E, check: building combined stage2 test runner)
891-
$(Q)$(CFG_PYTHON) $(S)src/etc/combine-tests.py
892-
893-
define DEF_CHECK_FAST_FOR_T_H
894-
# $(1) unused
895-
# $(2) target triple
896-
# $(3) host triple
897-
898-
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB): \
899-
tmp/$$(FT).rc \
900-
$$(SREQ2_T_$(2)_H_$(3))
901-
@$$(call E, oxidize: $$@)
902-
$$(STAGE2_T_$(2)_H_$(3)) --crate-type=dylib --out-dir $$(@D) $$< \
903-
-L "$$(RT_OUTPUT_DIR_$(2))"
904-
905-
$(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)): \
906-
tmp/$$(FT_DRIVER).rs \
907-
$$(TLIB2_T_$(2)_H_$(3))/$$(FT_LIB) \
908-
$$(SREQ2_T_$(2)_H_$(3))
909-
@$$(call E, oxidize: $$@ $$<)
910-
$$(STAGE2_T_$(2)_H_$(3)) -o $$@ $$< \
911-
-L "$$(RT_OUTPUT_DIR_$(2))"
912-
913-
$(3)/test/$$(FT_DRIVER)-$(2).out: \
914-
$(3)/test/$$(FT_DRIVER)-$(2)$$(X_$(2)) \
915-
$$(SREQ2_T_$(2)_H_$(3))
916-
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(2),$(3)) \
917-
--logfile tmp/$$(FT_DRIVER)-$(2).log
918-
919-
check-fast-T-$(2)-H-$(3): \
920-
$(3)/test/$$(FT_DRIVER)-$(2).out
921-
922-
endef
923-
924-
$(foreach host,$(CFG_HOST), \
925-
$(eval $(foreach target,$(CFG_TARGET), \
926-
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
927-
928-
check-fast: tidy check-fast-H-$(CFG_BUILD) \
929-
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate))
930-
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
931-
932-
define DEF_CHECK_FAST_FOR_H
933-
934-
check-fast-H-$(1): check-fast-T-$(1)-H-$(1)
935-
936-
endef
937-
938-
$(foreach host,$(CFG_HOST), \
939-
$(eval $(call DEF_CHECK_FAST_FOR_H,$(host))))
940-
941884
RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
942885
RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
943886

@@ -961,6 +904,7 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
961904
@rm -rf $(3)/test/run-make/$$*
962905
@mkdir -p $(3)/test/run-make/$$*
963906
$$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
907+
$$(MAKE) \
964908
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
965909
$(3)/test/run-make/$$* \
966910
"$$(CC_$(3)) $$(CFG_GCCISH_CFLAGS_$(3))" \

src/etc/combine-tests.py

-91
This file was deleted.

src/etc/maketest.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,26 @@
1212
import os
1313
import sys
1414

15-
os.putenv('RUSTC', os.path.abspath(sys.argv[2]))
16-
os.putenv('TMPDIR', os.path.abspath(sys.argv[3]))
17-
os.putenv('CC', sys.argv[4])
18-
os.putenv('RUSTDOC', os.path.abspath(sys.argv[5]))
19-
filt = sys.argv[6]
20-
ldpath = sys.argv[7]
15+
# FIXME #12303 these tests are broken on windows
16+
if os.name == 'nt':
17+
print 'ignoring make tests on windows'
18+
sys.exit(0)
19+
20+
make = sys.argv[2]
21+
os.putenv('RUSTC', os.path.abspath(sys.argv[3]))
22+
os.putenv('TMPDIR', os.path.abspath(sys.argv[4]))
23+
os.putenv('CC', sys.argv[5])
24+
os.putenv('RUSTDOC', os.path.abspath(sys.argv[6]))
25+
filt = sys.argv[7]
26+
ldpath = sys.argv[8]
2127
if ldpath != '':
2228
os.putenv(ldpath.split('=')[0], ldpath.split('=')[1])
2329

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

28-
proc = subprocess.Popen(['make', '-C', sys.argv[1]],
34+
proc = subprocess.Popen([make, '-C', sys.argv[1]],
2935
stdout = subprocess.PIPE,
3036
stderr = subprocess.PIPE)
3137
out, err = proc.communicate()

src/libnative/io/process.rs

+55-26
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ pub struct Process {
4040

4141
/// None until finish() is called.
4242
exit_code: Option<p::ProcessExit>,
43+
44+
/// Manually delivered signal
45+
exit_signal: Option<int>,
4346
}
4447

4548
impl Process {
@@ -107,7 +110,12 @@ impl Process {
107110

108111
match res {
109112
Ok(res) => {
110-
Ok((Process { pid: res.pid, handle: res.handle, exit_code: None },
113+
Ok((Process {
114+
pid: res.pid,
115+
handle: res.handle,
116+
exit_code: None,
117+
exit_signal: None,
118+
},
111119
ret_io))
112120
}
113121
Err(e) => Err(e)
@@ -127,6 +135,14 @@ impl rtio::RtioProcess for Process {
127135
Some(code) => code,
128136
None => {
129137
let code = waitpid(self.pid);
138+
// On windows, waitpid will never return a signal. If a signal
139+
// was successfully delivered to the process, however, we can
140+
// consider it as having died via a signal.
141+
let code = match self.exit_signal {
142+
None => code,
143+
Some(signal) if cfg!(windows) => p::ExitSignal(signal),
144+
Some(..) => code,
145+
};
130146
self.exit_code = Some(code);
131147
code
132148
}
@@ -157,7 +173,14 @@ impl rtio::RtioProcess for Process {
157173
}),
158174
None => {}
159175
}
160-
return unsafe { killpid(self.pid, signum) };
176+
177+
// A successfully delivered signal that isn't 0 (just a poll for being
178+
// alive) is recorded for windows (see wait())
179+
match unsafe { killpid(self.pid, signum) } {
180+
Ok(()) if signum == 0 => Ok(()),
181+
Ok(()) => { self.exit_signal = Some(signum); Ok(()) }
182+
Err(e) => Err(e),
183+
}
161184
}
162185
}
163186

@@ -256,31 +279,37 @@ fn spawn_process_os(config: p::ProcessConfig,
256279

257280
let cur_proc = GetCurrentProcess();
258281

259-
let orig_std_in = get_osfhandle(in_fd) as HANDLE;
260-
if orig_std_in == INVALID_HANDLE_VALUE as HANDLE {
261-
fail!("failure in get_osfhandle: {}", os::last_os_error());
262-
}
263-
if DuplicateHandle(cur_proc, orig_std_in, cur_proc, &mut si.hStdInput,
264-
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
265-
fail!("failure in DuplicateHandle: {}", os::last_os_error());
282+
if in_fd != -1 {
283+
let orig_std_in = get_osfhandle(in_fd) as HANDLE;
284+
if orig_std_in == INVALID_HANDLE_VALUE as HANDLE {
285+
fail!("failure in get_osfhandle: {}", os::last_os_error());
286+
}
287+
if DuplicateHandle(cur_proc, orig_std_in, cur_proc, &mut si.hStdInput,
288+
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
289+
fail!("failure in DuplicateHandle: {}", os::last_os_error());
290+
}
266291
}
267292

268-
let orig_std_out = get_osfhandle(out_fd) as HANDLE;
269-
if orig_std_out == INVALID_HANDLE_VALUE as HANDLE {
270-
fail!("failure in get_osfhandle: {}", os::last_os_error());
271-
}
272-
if DuplicateHandle(cur_proc, orig_std_out, cur_proc, &mut si.hStdOutput,
273-
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
274-
fail!("failure in DuplicateHandle: {}", os::last_os_error());
293+
if out_fd != -1 {
294+
let orig_std_out = get_osfhandle(out_fd) as HANDLE;
295+
if orig_std_out == INVALID_HANDLE_VALUE as HANDLE {
296+
fail!("failure in get_osfhandle: {}", os::last_os_error());
297+
}
298+
if DuplicateHandle(cur_proc, orig_std_out, cur_proc, &mut si.hStdOutput,
299+
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
300+
fail!("failure in DuplicateHandle: {}", os::last_os_error());
301+
}
275302
}
276303

277-
let orig_std_err = get_osfhandle(err_fd) as HANDLE;
278-
if orig_std_err == INVALID_HANDLE_VALUE as HANDLE {
279-
fail!("failure in get_osfhandle: {}", os::last_os_error());
280-
}
281-
if DuplicateHandle(cur_proc, orig_std_err, cur_proc, &mut si.hStdError,
282-
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
283-
fail!("failure in DuplicateHandle: {}", os::last_os_error());
304+
if err_fd != -1 {
305+
let orig_std_err = get_osfhandle(err_fd) as HANDLE;
306+
if orig_std_err == INVALID_HANDLE_VALUE as HANDLE {
307+
fail!("failure in get_osfhandle: {}", os::last_os_error());
308+
}
309+
if DuplicateHandle(cur_proc, orig_std_err, cur_proc, &mut si.hStdError,
310+
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE {
311+
fail!("failure in DuplicateHandle: {}", os::last_os_error());
312+
}
284313
}
285314

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

310-
assert!(CloseHandle(si.hStdInput) != 0);
311-
assert!(CloseHandle(si.hStdOutput) != 0);
312-
assert!(CloseHandle(si.hStdError) != 0);
339+
if in_fd != -1 { assert!(CloseHandle(si.hStdInput) != 0); }
340+
if out_fd != -1 { assert!(CloseHandle(si.hStdOutput) != 0); }
341+
if err_fd != -1 { assert!(CloseHandle(si.hStdError) != 0); }
313342

314343
match create_err {
315344
Some(err) => return Err(err),

src/test/auxiliary/crateresolve7x.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-fast
1211
// aux-build:crateresolve_calories-1.rs
1312
// aux-build:crateresolve_calories-2.rs
1413

src/test/auxiliary/issue-2414-b.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-fast
1211

1312
#[crate_id="b#0.1"];
1413
#[crate_type = "lib"];

src/test/auxiliary/issue-9906.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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

1413
pub use other::FooBar;

src/test/auxiliary/lang-item-public.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[no_std];
11+
#![no_std]
1212

1313
#[lang="fail_"]
1414
fn fail(_: *i8, _: *i8, _: uint) -> ! { loop {} }

src/test/compile-fail/ambig_impl_2_exe.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-fast aux-build
1211
// aux-build:ambig_impl_2_lib.rs
1312
extern crate ambig_impl_2_lib;
1413
use ambig_impl_2_lib::me;

src/test/compile-fail/asm-in-bad-modifier.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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

1413
fn foo(x: int) { println!("{}", x); }

src/test/compile-fail/asm-misplaced-option.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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

1413
#![feature(asm)]

0 commit comments

Comments
 (0)