Skip to content

Commit 4d478ea

Browse files
committed
---
yaml --- r: 277658 b: refs/heads/try c: 514b37e h: refs/heads/master
1 parent f2582fb commit 4d478ea

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 0cb9bc51759eed8ac12dc52456a2fbb7ddf495db
4+
refs/heads/try: 514b37e3d6810abcc511838a4f238afaa247e700
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ ifdef CFG_ENABLE_DEBUGINFO_TESTS
616616
CTEST_RUSTC_FLAGS += -g
617617
endif
618618

619-
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
619+
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
620620
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
621621
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
622622
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
@@ -686,7 +686,7 @@ $(foreach host,$(CFG_HOST), \
686686

687687
define DEF_RUN_COMPILETEST
688688

689-
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) = \
689+
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
690690
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
691691
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
692692
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
@@ -779,7 +779,7 @@ $(foreach host,$(CFG_HOST), \
779779

780780
define DEF_RUN_PRETTY_TEST
781781

782-
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) = \
782+
PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
783783
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
784784
--src-base $$(S)src/test/$$(PRETTY_DIRNAME_$(4))/ \
785785
--build-base $(3)/test/$$(PRETTY_DIRNAME_$(4))/ \

branches/try/src/tools/compiletest/src/runtest.rs

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,8 @@ fn compile_test(config: &Config, props: &TestProps,
11611161
let args = make_compile_args(config,
11621162
props,
11631163
link_args,
1164-
|a, b| TargetLocation::ThisFile(make_exe_name(a, b)), testpaths);
1164+
&testpaths.file,
1165+
TargetLocation::ThisFile(make_exe_name(config, testpaths)));
11651166
compose_and_run_compiler(config, props, testpaths, args, None)
11661167
}
11671168

@@ -1270,16 +1271,17 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
12701271
}
12711272
};
12721273
crate_type.extend(extra_link_args.clone());
1274+
let aux_output = {
1275+
let f = make_lib_name(config, &testpaths.file, testpaths);
1276+
let parent = f.parent().unwrap();
1277+
TargetLocation::ThisDirectory(parent.to_path_buf())
1278+
};
12731279
let aux_args =
12741280
make_compile_args(config,
12751281
&aux_props,
12761282
crate_type,
1277-
|a,b| {
1278-
let f = make_lib_name(a, &b.file, testpaths);
1279-
let parent = f.parent().unwrap();
1280-
TargetLocation::ThisDirectory(parent.to_path_buf())
1281-
},
1282-
&aux_testpaths);
1283+
&aux_testpaths.file,
1284+
aux_output);
12831285
let auxres = compose_and_run(config,
12841286
&aux_testpaths,
12851287
aux_args,
@@ -1328,22 +1330,21 @@ enum TargetLocation {
13281330
ThisDirectory(PathBuf),
13291331
}
13301332

1331-
fn make_compile_args<F>(config: &Config,
1332-
props: &TestProps,
1333-
extras: Vec<String> ,
1334-
xform: F,
1335-
testpaths: &TestPaths)
1336-
-> ProcArgs where
1337-
F: FnOnce(&Config, &TestPaths) -> TargetLocation,
1333+
fn make_compile_args(config: &Config,
1334+
props: &TestProps,
1335+
extras: Vec<String> ,
1336+
input_file: &Path,
1337+
output_file: TargetLocation)
1338+
-> ProcArgs
13381339
{
1339-
let xform_file = xform(config, testpaths);
13401340
let target = if props.force_host {
13411341
&*config.host
13421342
} else {
13431343
&*config.target
13441344
};
1345+
13451346
// FIXME (#9639): This needs to handle non-utf8 paths
1346-
let mut args = vec!(testpaths.file.to_str().unwrap().to_owned(),
1347+
let mut args = vec!(input_file.to_str().unwrap().to_owned(),
13471348
"-L".to_owned(),
13481349
config.build_base.to_str().unwrap().to_owned(),
13491350
format!("--target={}", target));
@@ -1384,7 +1385,7 @@ fn make_compile_args<F>(config: &Config,
13841385
args.push("-C".to_owned());
13851386
args.push("prefer-dynamic".to_owned());
13861387
}
1387-
let path = match xform_file {
1388+
let path = match output_file {
13881389
TargetLocation::ThisFile(path) => {
13891390
args.push("-o".to_owned());
13901391
path
@@ -1550,6 +1551,9 @@ fn output_testname(filepath: &Path) -> PathBuf {
15501551
PathBuf::from(filepath.file_stem().unwrap())
15511552
}
15521553

1554+
/// Given a test path like `compile-fail/foo/bar.rs` Returns a name like
1555+
///
1556+
/// <output>/foo/bar-stage1
15531557
fn output_base_name(config: &Config, testpaths: &TestPaths) -> PathBuf {
15541558
let dir = config.build_base.join(&testpaths.relative_dir);
15551559

@@ -1772,10 +1776,11 @@ fn compile_test_and_save_ir(config: &Config, props: &TestProps,
17721776
let args = make_compile_args(config,
17731777
props,
17741778
link_args,
1775-
|a, b| TargetLocation::ThisDirectory(
1776-
output_base_name(a, b).parent()
1777-
.unwrap().to_path_buf()),
1778-
testpaths);
1779+
&testpaths.file,
1780+
TargetLocation::ThisDirectory(
1781+
output_base_name(config, testpaths).parent()
1782+
.unwrap()
1783+
.to_path_buf()));
17791784
compose_and_run_compiler(config, props, testpaths, args, None)
17801785
}
17811786

0 commit comments

Comments
 (0)