Skip to content

Commit 0abf89a

Browse files
committed
---
yaml --- r: 92016 b: refs/heads/auto c: 6d6ccb7 h: refs/heads/master v: v3
1 parent 7571c04 commit 0abf89a

File tree

59 files changed

+434
-3
lines changed

Some content is hidden

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

59 files changed

+434
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 9fbba7b2eeabd073f9518f2dbd50f4eabb621c67
16+
refs/heads/auto: 6d6ccb75ff2240ed294fcf6aa57e96c72316954c
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/tests.mk

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ check-lite: cleantestlibs cleantmptestlogs \
193193
check-stage2-std check-stage2-extra check-stage2-rpass \
194194
check-stage2-rustuv \
195195
check-stage2-rustpkg \
196-
check-stage2-rfail check-stage2-cfail
196+
check-stage2-rfail check-stage2-cfail check-stage2-rmake
197197
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
198198

199199
.PHONY: cleantmptestlogs cleantestlibs
@@ -284,7 +284,8 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
284284
check-stage$(1)-T-$(2)-H-$(3)-rfail-exec \
285285
check-stage$(1)-T-$(2)-H-$(3)-cfail-exec \
286286
check-stage$(1)-T-$(2)-H-$(3)-rpass-full-exec \
287-
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
287+
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec \
288+
check-stage$(1)-T-$(2)-H-$(3)-crates-exec \
288289
check-stage$(1)-T-$(2)-H-$(3)-bench-exec \
289290
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-exec \
290291
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
@@ -770,6 +771,7 @@ TEST_GROUPS = \
770771
cfail \
771772
bench \
772773
perf \
774+
rmake \
773775
debuginfo \
774776
codegen \
775777
doc \
@@ -900,3 +902,36 @@ endef
900902

901903
$(foreach host,$(CFG_HOST), \
902904
$(eval $(call DEF_CHECK_FAST_FOR_H,$(host))))
905+
906+
RMAKE_TESTS := $(shell ls -d $(S)src/test/run-make/*/)
907+
RMAKE_TESTS := $(RMAKE_TESTS:$(S)src/test/run-make/%/=%)
908+
909+
define DEF_RMAKE_FOR_T_H
910+
# $(1) the stage
911+
# $(2) target triple
912+
# $(3) host triple
913+
914+
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec: \
915+
$$(call TEST_OK_FILE,$(1),$(2),$(3),rmake)
916+
917+
$$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
918+
$$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
919+
@touch $$@
920+
921+
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
922+
$(S)src/test/run-make/%/Makefile \
923+
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
924+
@rm -rf $(3)/test/run-make/$$*
925+
@mkdir -p $(3)/test/run-make/$$*
926+
@echo maketest: $$*
927+
@python $(S)src/etc/maketest.py $$(dir $$<) \
928+
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
929+
$(3)/test/run-make/$$*
930+
@touch $$@
931+
932+
endef
933+
934+
$(foreach stage,$(STAGES), \
935+
$(foreach target,$(CFG_TARGET), \
936+
$(foreach host,$(CFG_HOST), \
937+
$(eval $(call DEF_RMAKE_FOR_T_H,$(stage),$(target),$(host))))))

branches/auto/src/etc/maketest.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# xfail-license
2+
3+
import subprocess
4+
import os
5+
import sys
6+
7+
os.putenv('RUSTC', os.path.abspath(sys.argv[2]))
8+
os.putenv('TMPDIR', os.path.abspath(sys.argv[3]))
9+
10+
proc = subprocess.Popen(['make', '-C', sys.argv[1]],
11+
stdout = subprocess.PIPE,
12+
stderr = subprocess.PIPE)
13+
out, err = proc.communicate()
14+
i = proc.wait()
15+
16+
if i != 0:
17+
18+
print '----- ' + sys.argv[1] + """ --------------------
19+
------ stdout ---------------------------------------------
20+
""" + out + """
21+
------ stderr ---------------------------------------------
22+
""" + err + """
23+
------ ---------------------------------------------
24+
"""
25+
sys.exit(i)
26+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-include ../tools.mk
2+
3+
# This hits an assertion in the linker on older versions of osx apparently
4+
ifeq ($(shell uname),Darwin)
5+
all:
6+
echo ignored
7+
else
8+
all: $(call DYLIB,cfoo)
9+
$(RUSTC) foo.rs
10+
$(RUSTC) bar.rs
11+
$(call RUN,bar)
12+
rm $(TMPDIR)/$(call DYLIB_GLOB,cfoo)
13+
$(call FAIL,bar)
14+
endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod foo;
2+
3+
fn main() {
4+
foo::rsfoo();
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int foo() { return 0; }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[crate_type = "dylib"];
2+
3+
#[link(name = "cfoo")]
4+
extern {
5+
fn foo();
6+
}
7+
8+
pub fn rsfoo() {
9+
unsafe { foo() }
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-include ../tools.mk
2+
3+
# This hits an assertion in the linker on older versions of osx apparently
4+
ifeq ($(shell uname),Darwin)
5+
all:
6+
echo ignored
7+
else
8+
all: $(call DYLIB,cfoo)
9+
$(RUSTC) foo.rs
10+
$(RUSTC) bar.rs
11+
LD_LIBRARY_PATH=$(TMPDIR) $(call RUN,bar)
12+
rm $(TMPDIR)/$(call DYLIB_GLOB,cfoo)
13+
$(call FAIL,bar)
14+
endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod foo;
2+
3+
fn main() {
4+
foo::rsfoo();
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int foo() { return 0; }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[crate_type = "rlib"];
2+
3+
#[link(name = "cfoo")]
4+
extern {
5+
fn foo();
6+
}
7+
8+
pub fn rsfoo() {
9+
unsafe { foo() }
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) foo.rs
5+
ln -s $(call DYLIB,foo-*) $(call DYLIB,foo)
6+
$(CC) bar.c -lfoo -o $(call RUN,bar) -Wl,-rpath,$(TMPDIR)
7+
$(call RUN,bar)
8+
rm $(call DYLIB,foo)
9+
$(call FAIL,bar)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
void foo();
2+
3+
int main() {
4+
foo();
5+
return 0;
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "dylib"];
2+
3+
#[no_mangle]
4+
pub extern "C" fn foo() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-include ../tools.mk
2+
3+
ifneq ($(shell uname),Darwin)
4+
EXTRAFLAGS := -lm -lrt -ldl -lpthread
5+
endif
6+
7+
all:
8+
$(RUSTC) foo.rs -Z gen-crate-map
9+
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
10+
$(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
11+
$(call RUN,bar)
12+
rm $(call STATICLIB,foo*)
13+
$(call RUN,bar)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
void foo();
2+
3+
int main() {
4+
foo();
5+
return 0;
6+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "staticlib"];
2+
3+
#[no_mangle]
4+
pub extern "C" fn foo() {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-include ../tools.mk
2+
3+
all: $(call STATICLIB,cfoo)
4+
$(RUSTC) foo.rs
5+
$(RUSTC) bar.rs
6+
rm $(TMPDIR)/$(call STATICLIB_GLOB,cfoo)
7+
$(call RUN,bar)
8+
rm $(TMPDIR)/$(call DYLIB_GLOB,foo)
9+
$(call FAIL,bar)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod foo;
2+
3+
fn main() {
4+
foo::rsfoo();
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int foo() { return 0; }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[crate_type = "dylib"];
2+
3+
#[link(name = "cfoo")]
4+
extern {
5+
fn foo();
6+
}
7+
8+
pub fn rsfoo() {
9+
unsafe { foo() }
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-include ../tools.mk
2+
3+
all: $(call STATICLIB,cfoo)
4+
$(RUSTC) foo.rs
5+
$(RUSTC) bar.rs
6+
rm $(TMPDIR)/$(call RLIB_GLOB,foo)
7+
rm $(TMPDIR)/$(call STATICLIB_GLOB,cfoo)
8+
$(call RUN,bar)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod foo;
2+
3+
fn main() {
4+
foo::rsfoo();
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int foo() { return 0; }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[crate_type = "rlib"];
2+
3+
#[link(name = "cfoo")]
4+
extern {
5+
fn foo();
6+
}
7+
8+
pub fn rsfoo() {
9+
unsafe { foo() }
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) m1.rs
5+
$(RUSTC) m2.rs
6+
$(RUSTC) m3.rs
7+
$(RUSTC) m4.rs
8+
$(call RUN,m4)
9+
rm $(TMPDIR)/$(call DYLIB_GLOB,m1)
10+
rm $(TMPDIR)/$(call DYLIB_GLOB,m2)
11+
rm $(TMPDIR)/$(call DYLIB_GLOB,m3)
12+
$(call FAIL,m4)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[crate_type = "dylib"];
2+
pub fn m1() {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "dylib"];
2+
extern mod m1;
3+
4+
pub fn m2() { m1::m1() }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "dylib"];
2+
extern mod m2;
3+
4+
pub fn m3() { m2::m2() }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extern mod m3;
2+
3+
fn main() { m3::m3() }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) both.rs
5+
$(RUSTC) dylib.rs -Z prefer-dynamic
6+
$(RUSTC) prog.rs
7+
$(call RUN,prog)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "rlib"];
2+
#[crate_type = "dylib"];
3+
4+
pub static foo: int = 4;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[crate_type = "dylib"];
2+
extern mod both;
3+
4+
use std::cast;
5+
6+
pub fn addr() -> uint { unsafe { cast::transmute(&both::foo) } }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extern mod dylib;
2+
extern mod both;
3+
4+
use std::cast;
5+
6+
fn main() {
7+
assert_eq!(unsafe { cast::transmute::<&int, uint>(&both::foo) },
8+
dylib::addr());
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) rlib.rs
5+
$(RUSTC) dylib.rs && exit 1 || exit 0
6+
$(RUSTC) rlib.rs --dylib
7+
$(RUSTC) dylib.rs
8+
rm $(call DYLIB,rlib-*)
9+
$(RUSTC) prog.rs && exit 1 || exit 0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[crate_type = "dylib"];
2+
extern mod rlib;
3+
4+
pub fn dylib() { rlib::rlib() }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extern mod dylib;
2+
extern mod rlib;
3+
4+
fn main() {
5+
dylib::dylib();
6+
rlib::rlib();
7+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[crate_type = "rlib"];
2+
pub fn rlib() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) bar.rs --dylib --rlib
5+
$(RUSTC) foo.rs -Z prefer-dynamic
6+
$(call RUN,foo)
7+
rm $(TMPDIR)/*bar*
8+
$(call FAILS,foo)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn bar() {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod bar;
2+
3+
fn main() {
4+
bar::bar();
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) bar.rs --dylib --rlib
5+
ls $(TMPDIR)/$(call RLIB_GLOB,bar)
6+
$(RUSTC) foo.rs
7+
rm $(TMPDIR)/*bar*
8+
$(call RUN,foo)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub fn bar() {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern mod bar;
2+
3+
fn main() {
4+
bar::bar();
5+
}

0 commit comments

Comments
 (0)