Skip to content

Commit 38ee447

Browse files
committed
---
yaml --- r: 59858 b: refs/heads/master c: 3afd708 h: refs/heads/master v: v3
1 parent 8648168 commit 38ee447

Some content is hidden

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

63 files changed

+1298
-549
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: 941154721ef294149710597409a38294db2a6e07
2+
refs/heads/master: 3afd708e2acd767f1af90de52c139c1b6b877311
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: 108 additions & 5 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,35 @@ 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+
417502
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
418503
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
419504
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
420505
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
421506
--aux-base $$(S)src/test/auxiliary/ \
422507
--stage-id stage$(1)-$(2) \
508+
--host $(CFG_BUILD_TRIPLE) \
509+
--target $(2) \
510+
--adb-path=$(CFG_ADB_PATH) \
423511
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
424512
$$(CTEST_TESTARGS)
425513

514+
else
515+
516+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
517+
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
518+
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
519+
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
520+
--aux-base $$(S)src/test/auxiliary/ \
521+
--stage-id stage$(1)-$(2) \
522+
--host $(CFG_BUILD_TRIPLE) \
523+
--target $(2) \
524+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
525+
$$(CTEST_TESTARGS)
526+
527+
endif
528+
426529
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)
427530
CTEST_DEPS_rpass_full_$(1)-T-$(2)-H-$(3) = $$(RPASS_FULL_TESTS) $$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
428531
CTEST_DEPS_rfail_$(1)-T-$(2)-H-$(3) = $$(RFAIL_TESTS)
@@ -454,7 +557,7 @@ ifeq ($$(CTEST_DISABLE_$(4)),)
454557
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
455558
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
456559
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
457-
@$$(call E, run $(4): $$<)
560+
@$$(call E, run $(4) [$(2)]: $$<)
458561
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
459562
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
460563
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
@@ -465,7 +568,7 @@ else
465568
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
466569
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
467570
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
468-
@$$(call E, run $(4): $$<)
571+
@$$(call E, run $(4) [$(2)]: $$<)
469572
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
470573
touch $$@
471574

@@ -506,7 +609,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
506609
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
507610
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
508611
$$(PRETTY_DEPS_$(4))
509-
@$$(call E, run pretty-rpass: $$<)
612+
@$$(call E, run pretty-rpass [$(2)]: $$<)
510613
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
511614
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
512615
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
@@ -533,7 +636,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3)
533636
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
534637
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
535638
doc-$(4)-extract$(3)
536-
@$$(call E, run doc-$(4): $$<)
639+
@$$(call E, run doc-$(4) [$(2)]: $$<)
537640
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
538641
$$(DOC_TEST_ARGS$(1)-T-$(2)-H-$(3)-doc-$(4)) \
539642
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),doc-$(4)) \

trunk/src/compiletest/common.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ 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 arm-linux-androideabi
74+
adb_path: ~str,
75+
76+
// check if can be run or not
77+
flag_runnable: bool,
78+
6779
// Explain what's going on
6880
verbose: bool
6981

trunk/src/compiletest/compiletest.rc

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ 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+
];
6468

6569
assert!(!args.is_empty());
6670
let args_ = vec::tail(args);
@@ -93,6 +97,22 @@ pub fn parse_config(args: ~[~str]) -> config {
9397
rustcflags: getopts::opt_maybe_str(matches, ~"rustcflags"),
9498
jit: getopts::opt_present(matches, ~"jit"),
9599
newrt: getopts::opt_present(matches, ~"newrt"),
100+
host: opt_str(getopts::opt_maybe_str(matches, ~"host")),
101+
target: opt_str(getopts::opt_maybe_str(matches, ~"target")),
102+
adb_path: opt_str(getopts::opt_maybe_str(matches, ~"adb-path")),
103+
flag_runnable:
104+
if (getopts::opt_maybe_str(matches, ~"host") ==
105+
getopts::opt_maybe_str(matches, ~"target")) { true }
106+
else {
107+
match getopts::opt_maybe_str(matches, ~"target") {
108+
Some(~"arm-linux-androideabi") => {
109+
if (getopts::opt_maybe_str(matches, ~"adb-path") !=
110+
option::None) { true }
111+
else { false }
112+
}
113+
_ => { false }
114+
}
115+
},
96116
verbose: getopts::opt_present(matches, ~"verbose")
97117
}
98118
}
@@ -113,6 +133,10 @@ pub fn log_config(config: config) {
113133
logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
114134
logv(c, fmt!("jit: %b", config.jit));
115135
logv(c, fmt!("newrt: %b", config.newrt));
136+
logv(c, fmt!("host: %s", config.host));
137+
logv(c, fmt!("target: %s", config.target));
138+
logv(c, fmt!("adb_path: %s", config.adb_path));
139+
logv(c, fmt!("flag_runnable: %b", config.flag_runnable));
116140
logv(c, fmt!("verbose: %b", config.verbose));
117141
logv(c, fmt!("\n"));
118142
}

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)