Skip to content

Commit d4b90d0

Browse files
committed
---
yaml --- r: 59876 b: refs/heads/master c: 6f6dd86 h: refs/heads/master v: v3
1 parent 0339dd6 commit d4b90d0

File tree

130 files changed

+2091
-1252
lines changed

Some content is hidden

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

130 files changed

+2091
-1252
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: efcabc41e4ab4dbabd3f6d0954b5a1184ad75e8b
2+
refs/heads/master: 6f6dd86248d5c3ece0e668537e78a71198f36ddd
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,8 @@ A complete list of the built-in language items follows:
14671467
: Elements can be subtracted.
14681468
`mul`
14691469
: Elements can be multiplied.
1470-
`div`
1471-
: Elements have a division operation.
1470+
`quot`
1471+
: Elements have a quotient operation.
14721472
`rem`
14731473
: Elements have a remainder operation.
14741474
`neg`
@@ -1857,7 +1857,7 @@ The default meaning of the operators on standard types is given here.
18571857
Calls the `mul` method on the `core::ops::Mul` trait.
18581858
`/`
18591859
: Quotient.
1860-
Calls the `div` method on the `core::ops::Div` trait.
1860+
Calls the `quot` method on the `core::ops::Quot` trait.
18611861
`%`
18621862
: Remainder.
18631863
Calls the `rem` method on the `core::ops::Rem` trait.

trunk/mk/install.mk

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,66 @@ uninstall:
154154
done
155155
$(Q)rm -Rf $(PHL)/rustc
156156
$(Q)rm -f $(PREFIX_ROOT)/share/man/man1/rustc.1
157+
158+
# target platform specific variables
159+
# for arm-linux-androidabi
160+
define DEF_ADB_STATUS
161+
CFG_ADB_DEVICE=$(1)
162+
endef
163+
164+
$(foreach target,$(CFG_TARGET_TRIPLES), \
165+
$(if $(findstring $(target),"arm-linux-androideabi"), \
166+
$(if $(findstring adb,$(shell which adb)), \
167+
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
168+
$(info install: install-runtime-target for arm-linux-androideabi enabled \
169+
$(info install: android device attached) \
170+
$(eval $(call DEF_ADB_STATUS, true))), \
171+
$(info install: install-runtime-target for arm-linux-androideabi disabled \
172+
$(info install: android device not attached) \
173+
$(eval $(call DEF_ADB_STATUS, false))) \
174+
), \
175+
$(info install: install-runtime-target for arm-linux-androideabi disabled \
176+
$(info install: adb not found) \
177+
$(eval $(call DEF_ADB_STATUS, false))) \
178+
), \
179+
) \
180+
)
181+
182+
ifeq ($(CFG_ADB_DEVICE),true)
183+
184+
ifdef VERBOSE
185+
ADB = adb $(1)
186+
ADB_PUSH = adb push $(1) $(2)
187+
ADB_SHELL = adb shell $(1) $(2)
188+
else
189+
ADB = $(Q)$(call E, adb $(1)) && adb $(1) 1>/dev/null 2>/dev/null
190+
ADB_PUSH = $(Q)$(call E, adb push $(1)) && adb push $(1) $(2) 1>/dev/null 2>/dev/null
191+
ADB_SHELL = $(Q)$(call E, adb shell $(1) $(2)) && adb shell $(1) $(2) 1>/dev/null 2>/dev/null
192+
endif
193+
194+
define INSTALL_RUNTIME_TARGET_N
195+
install-runtime-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
196+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CFG_RUNTIME_$(1)),/system/lib)
197+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(CORELIB_GLOB_$(1)),/system/lib)
198+
$(Q)$(call ADB_PUSH,$$(TL$(1)$(2))/$$(STDLIB_GLOB_$(1)),/system/lib)
199+
endef
200+
201+
define INSTALL_RUNTIME_TARGET_CLEANUP_N
202+
install-runtime-target-$(1)-cleanup:
203+
$(Q)$(call ADB,remount)
204+
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CFG_RUNTIME_$(1)))
205+
$(Q)$(call ADB_SHELL,rm,/system/lib/$(CORELIB_GLOB_$(1)))
206+
$(Q)$(call ADB_SHELL,rm,/system/lib/$(STDLIB_GLOB_$(1)))
207+
endef
208+
209+
$(eval $(call INSTALL_RUNTIME_TARGET_N,arm-linux-androideabi,$(CFG_BUILD_TRIPLE)))
210+
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-androideabi))
211+
212+
install-runtime-target: \
213+
install-runtime-target-arm-linux-androideabi-cleanup \
214+
install-runtime-target-arm-linux-androideabi-host-$(CFG_BUILD_TRIPLE)
215+
216+
else
217+
install-runtime-target:
218+
@echo
219+
endif

trunk/mk/tests.mk

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,48 @@ endef
9292
$(foreach target,$(CFG_TARGET_TRIPLES), \
9393
$(eval $(call DEF_TARGET_COMMANDS,$(target))))
9494

95+
# Target specific variables
96+
# for arm-linux-androidabi
97+
define DEF_RUNNABLE_STATUS
98+
CFG_RUNNABLE_$(1)=$(2)
99+
endef
100+
101+
$(foreach target,$(CFG_TARGET_TRIPLES), \
102+
$(if $(findstring $(target),$(CFG_BUILD_TRIPLE)), \
103+
$(info check: $(target) test set is runnable \
104+
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
105+
$(if $(findstring $(target),"arm-linux-androideabi"), \
106+
$(if $(findstring adb,$(shell which adb)), \
107+
$(if $(findstring device,$(shell adb devices 2>/dev/null | grep -E '^[A-Za-z0-9]+[[:blank:]]+device')), \
108+
$(info check: $(target) test set is runnable \
109+
$(info check: adb device attached) \
110+
$(eval $(call DEF_RUNNABLE_STATUS,$(target),true))), \
111+
$(info check: $(target) test set is not runnable \
112+
$(info check: adb device not attached) \
113+
$(eval $(call DEF_RUNNABLE_STATUS,$(target),false))) \
114+
), \
115+
$(info check: $(target) test set is not runnable \
116+
$(info check: adb not found) \
117+
$(eval $(call DEF_RUNNABLE_STATUS,$(target),false))) \
118+
), \
119+
$(info check: $(target) test set is not runnable \
120+
$(eval $(call DEF_RUNNABLE_STATUS,$(target),false)) \
121+
) \
122+
) \
123+
) \
124+
)
125+
126+
ifeq ($(CFG_RUNNABLE_arm-linux-androideabi),true)
127+
CFG_ADB_DEVICE=true
128+
CFG_ADB_PATH := $(shell which adb)
129+
CFG_ADB_TEST_DIR=/system/tmp
130+
131+
$(info check: device $(CFG_ADB_TEST_DIR) \
132+
$(shell $(CFG_ADB_PATH) shell mkdir $(CFG_ADB_TEST_DIR) 1>/dev/null) \
133+
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*-arm-linux-androideabi 1>/dev/null) \
134+
$(shell $(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/*.so 1>/dev/null) \
135+
)
136+
endif
95137

96138
######################################################################
97139
# Main test targets
@@ -319,11 +361,52 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
319361
&& touch $$@
320362
endef
321363

364+
define DEF_TEST_CRATE_RULES_arm-linux-androideabi
365+
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
366+
367+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
368+
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
369+
@$$(call E, run: $$< via adb)
370+
@$(CFG_ADB_PATH) push $$< $(CFG_ADB_TEST_DIR)
371+
@$(CFG_ADB_PATH) shell $(CFG_ADB_TEST_DIR)/`echo $$< | sed 's/.*\///'` \
372+
--logfile $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log > \
373+
tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
374+
@cat tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp
375+
@touch tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
376+
@$(CFG_ADB_PATH) pull $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log tmp/
377+
@$(CFG_ADB_PATH) shell rm $(CFG_ADB_TEST_DIR)/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
378+
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
379+
then \
380+
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
381+
touch $$@; \
382+
else \
383+
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
384+
exit 101; \
385+
fi
386+
endef
387+
388+
define DEF_TEST_CRATE_RULES_null
389+
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
390+
391+
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
392+
$(3)/test/$(4)test.stage$(1)-$(2)$$(X_$(2))
393+
@$$(call E, run: skipped $$< )
394+
@touch $$@
395+
endef
396+
322397
$(foreach host,$(CFG_HOST_TRIPLES), \
323398
$(foreach target,$(CFG_TARGET_TRIPLES), \
324399
$(foreach stage,$(STAGES), \
325400
$(foreach crate, $(TEST_CRATES), \
326-
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate)))))))
401+
$(if $(findstring $(target),$(CFG_BUILD_TRIPLE)), \
402+
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
403+
$(if $(findstring $(target),"arm-linux-androideabi"), \
404+
$(if $(findstring $(CFG_RUNNABLE_arm-linux-androideabi),"true"), \
405+
$(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
406+
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
407+
), \
408+
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
409+
))))))
327410

328411

329412
######################################################################
@@ -414,15 +497,36 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
414497

415498
# Rules for the cfail/rfail/rpass/bench/perf test runner
416499

500+
ifeq ($(CFG_ADB_DEVICE),true)
501+
502+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
503+
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
504+
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
505+
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
506+
--aux-base $$(S)src/test/auxiliary/ \
507+
--stage-id stage$(1)-$(2) \
508+
--host $(CFG_BUILD_TRIPLE) \
509+
--target $(2) \
510+
--adb-path=$(CFG_ADB_PATH) \
511+
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
512+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
513+
$$(CTEST_TESTARGS)
514+
515+
else
516+
417517
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
418518
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
419519
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
420-
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
520+
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
421521
--aux-base $$(S)src/test/auxiliary/ \
422522
--stage-id stage$(1)-$(2) \
523+
--host $(CFG_BUILD_TRIPLE) \
524+
--target $(2) \
423525
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
424526
$$(CTEST_TESTARGS)
425527

528+
endif
529+
426530
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
427531
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
428532
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
@@ -454,7 +558,7 @@ ifeq ($$(CTEST_DISABLE_$(4)),)
454558
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
455559
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
456560
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
457-
@$$(call E, run $(4): $$<)
561+
@$$(call E, run $(4) [$(2)]: $$<)
458562
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
459563
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
460564
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
@@ -465,7 +569,7 @@ else
465569
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
466570
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
467571
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
468-
@$$(call E, run $(4): $$<)
572+
@$$(call E, run $(4) [$(2)]: $$<)
469573
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
470574
touch $$@
471575

@@ -506,7 +610,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
506610
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
507611
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
508612
$$(PRETTY_DEPS_$(4))
509-
@$$(call E, run pretty-rpass: $$<)
613+
@$$(call E, run pretty-rpass [$(2)]: $$<)
510614
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
511615
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
512616
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
@@ -533,7 +637,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3)
533637
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
534638
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
535639
doc-$(4)-extract$(3)
536-
@$$(call E, run doc-$(4): $$<)
640+
@$$(call E, run doc-$(4) [$(2)]: $$<)
537641
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
538642
$$(DOC_TEST_ARGS$(1)-T-$(2)-H-$(3)-doc-$(4)) \
539643
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),doc-$(4)) \

trunk/src/compiletest/common.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ pub struct config {
6464
// Run tests using the new runtime
6565
newrt: bool,
6666

67+
// Host System to be built
68+
host: ~str,
69+
70+
// Target System to be executed
71+
target: ~str,
72+
73+
// Extra parameter to run adb on arm-linux-androideabi
74+
adb_path: ~str,
75+
76+
// Extra parameter to run test sute on arm-linux-androideabi
77+
adb_test_dir: ~str,
78+
79+
// check if can be run or not
80+
flag_runnable: bool,
81+
6782
// Explain what's going on
6883
verbose: bool
6984

trunk/src/compiletest/compiletest.rc

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ pub fn parse_config(args: ~[~str]) -> config {
6060
getopts::optflag(~"verbose"),
6161
getopts::optopt(~"logfile"),
6262
getopts::optflag(~"jit"),
63-
getopts::optflag(~"newrt")];
63+
getopts::optflag(~"newrt"),
64+
getopts::optopt(~"host"),
65+
getopts::optopt(~"target"),
66+
getopts::optopt(~"adb-path"),
67+
getopts::optopt(~"adb-test-dir")
68+
];
6469

6570
assert!(!args.is_empty());
6671
let args_ = vec::tail(args);
@@ -93,6 +98,23 @@ pub fn parse_config(args: ~[~str]) -> config {
9398
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
9499
jit: getopts::opt_present(matches, ~"jit"),
95100
newrt: getopts::opt_present(matches, ~"newrt"),
101+
host: opt_str(getopts::opt_maybe_str(matches, ~"host")),
102+
target: opt_str(getopts::opt_maybe_str(matches, ~"target")),
103+
adb_path: opt_str(getopts::opt_maybe_str(matches, ~"adb-path")),
104+
adb_test_dir: opt_str(getopts::opt_maybe_str(matches, ~"adb-test-dir")),
105+
flag_runnable:
106+
if (getopts::opt_maybe_str(matches, ~"host") ==
107+
getopts::opt_maybe_str(matches, ~"target")) { true }
108+
else {
109+
match getopts::opt_maybe_str(matches, ~"target") {
110+
Some(~"arm-linux-androideabi") => {
111+
if (getopts::opt_maybe_str(matches, ~"adb-path") !=
112+
option::None) { true }
113+
else { false }
114+
}
115+
_ => { false }
116+
}
117+
},
96118
verbose: getopts::opt_present(matches, ~"verbose")
97119
}
98120
}
@@ -113,6 +135,11 @@ pub fn log_config(config: config) {
113135
logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
114136
logv(c, fmt!("jit: %b", config.jit));
115137
logv(c, fmt!("newrt: %b", config.newrt));
138+
logv(c, fmt!("host: %s", config.host));
139+
logv(c, fmt!("target: %s", config.target));
140+
logv(c, fmt!("adb_path: %s", config.adb_path));
141+
logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir));
142+
logv(c, fmt!("flag_runnable: %b", config.flag_runnable));
116143
logv(c, fmt!("verbose: %b", config.verbose));
117144
logv(c, fmt!("\n"));
118145
}
@@ -223,3 +250,10 @@ pub fn make_test_closure(config: config, testfile: &Path) -> test::TestFn {
223250
let testfile = testfile.to_str();
224251
test::DynTestFn(|| runtest::run(config, testfile))
225252
}
253+
254+
// Local Variables:
255+
// fill-column: 78;
256+
// indent-tabs-mode: nil
257+
// c-basic-offset: 4
258+
// buffer-file-coding-system: utf-8-unix
259+
// End:

trunk/src/compiletest/header.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ pub fn load_props(testfile: &Path) -> TestProps {
8282
}
8383

8484
pub fn is_test_ignored(config: config, testfile: &Path) -> bool {
85+
let mut found = false;
8586
for iter_header(testfile) |ln| {
8687
if parse_name_directive(ln, ~"xfail-test") { return true; }
8788
if parse_name_directive(ln, xfail_target()) { return true; }
8889
if config.mode == common::mode_pretty &&
8990
parse_name_directive(ln, ~"xfail-pretty") { return true; }
9091
};
91-
return false;
92+
return found;
9293

9394
fn xfail_target() -> ~str {
9495
~"xfail-" + str::from_slice(os::SYSNAME)

0 commit comments

Comments
 (0)