Skip to content

Commit 31853f3

Browse files
committed
build: Don't require full target libs to run compiletest tests
Only build through librustsyntax, which some tests do rely on.
1 parent 2d793ef commit 31853f3

File tree

5 files changed

+43
-50
lines changed

5 files changed

+43
-50
lines changed

mk/tests.mk

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ define TEST_STAGEN
166166
# $(2) is the target triple to test
167167
# $(3) is the host triple to test
168168

169+
# Prerequisites for compiletest tests
170+
TEST_SREQ$(1)_T_$(2)_H_$(3) = \
171+
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
172+
$$(HSREQ$(1)_$(2)_$(3)) \
173+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTSYNTAX)
174+
175+
169176
check-stage$(1)-T-$(2)-H-$(3): tidy \
170177
check-stage$(1)-T-$(2)-H-$(3)-rustc \
171178
check-stage$(1)-T-$(2)-H-$(3)-core \
@@ -373,98 +380,87 @@ DOC_REF_ARGS$(1)-T-$(2)-H-$(3) := \
373380
--mode run-pass
374381

375382
check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy: \
376-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
377-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
383+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
378384
$$(CFAIL_TESTS)
379385
@$$(call E, run cfail: $$<)
380386
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
381387
$$(CFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
382388
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-cfail.log
383389

384390
check-stage$(1)-T-$(2)-H-$(3)-rfail-dummy: \
385-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
386-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
391+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
387392
$$(RFAIL_TESTS)
388393
@$$(call E, run rfail: $$<)
389394
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
390395
$$(RFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
391396
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rfail.log
392397

393398
check-stage$(1)-T-$(2)-H-$(3)-rpass-dummy: \
394-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
395-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
399+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
396400
$$(RPASS_TESTS)
397401
@$$(call E, run rpass: $$<)
398402
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
399403
$$(RPASS_ARGS$(1)-T-$(2)-H-$(3)) \
400404
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-rpass.log
401405

402406
check-stage$(1)-T-$(2)-H-$(3)-bench-dummy: \
403-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
404-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
407+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
405408
$$(BENCH_TESTS)
406409
@$$(call E, run bench: $$<)
407410
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
408411
$$(BENCH_ARGS$(1)-T-$(2)-H-$(3)) \
409412
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-bench.log
410413

411414
check-stage$(1)-T-$(2)-H-$(3)-perf-dummy: \
412-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
413-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
415+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
414416
$$(BENCH_TESTS)
415417
@$$(call E, perf: $$<)
416418
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
417419
$$(PERF_ARGS$(1)-T-$(2)-H-$(3)) \
418420
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-perf.log
419421

420422
check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass-dummy: \
421-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
422-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
423+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
423424
$$(RPASS_TESTS)
424425
@$$(call E, run pretty-rpass: $$<)
425426
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
426427
$$(PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3)) \
427428
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-rpass.log
428429

429430
check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail-dummy: \
430-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
431-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
431+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
432432
$$(RFAIL_TESTS)
433433
@$$(call E, run pretty-rfail: $$<)
434434
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
435435
$$(PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3)) \
436436
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-rfail.log
437437

438438
check-stage$(1)-T-$(2)-H-$(3)-pretty-bench-dummy: \
439-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
440-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
439+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
441440
$$(BENCH_TESTS)
442441
@$$(call E, run pretty-bench: $$<)
443442
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
444443
$$(PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3)) \
445444
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-bench.log
446445

447446
check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty-dummy: \
448-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
449-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
447+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
450448
$$(PRETTY_TESTS)
451449
@$$(call E, run pretty-pretty: $$<)
452450
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
453451
$$(PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3)) \
454452
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-pretty-pretty.log
455453

456454
check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial-dummy: \
457-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
458-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
455+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
459456
doc-tutorial-extract$(3)
460457
@$$(call E, run doc-tutorial: $$<)
461458
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \
462459
$$(DOC_TUTORIAL_ARGS$(1)-T-$(2)-H-$(3)) \
463460
--logfile tmp/check-stage$(1)-T-$(2)-H-$(3)-doc-tutorial.log
464461

465462
check-stage$(1)-T-$(2)-H-$(3)-doc-ref-dummy: \
466-
$$(HBIN$(1)_H_$(3))/compiletest$$(X) \
467-
$$(SREQ$(1)_T_$(2)_H_$(3)) \
463+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
468464
doc-ref-extract$(3)
469465
@$$(call E, run doc-ref: $$<)
470466
$$(Q)$$(call CFG_RUN_CTEST,$(1),$$<,$(3)) \

src/test/compile-fail/qquote-1.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// xfail-pretty
22

33
use std;
4-
use rustc;
4+
use syntax(name = "rustsyntax");
55

6-
import rustc::*;
76
import io::*;
87

9-
import rustc::driver::diagnostic;
10-
import rustc::syntax::ast;
11-
import rustc::syntax::codemap;
12-
import rustc::syntax::parse;
13-
import rustc::syntax::print::*;
8+
import syntax::diagnostic;
9+
import syntax::ast;
10+
import syntax::codemap;
11+
import syntax::parse;
12+
import syntax::print::*;
1413

1514
fn new_parse_sess() -> parse::parse_sess {
1615
fail;

src/test/compile-fail/qquote-2.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// xfail-pretty
22

33
use std;
4-
use rustc;
4+
use syntax(name = "rustsyntax");
55

6-
import rustc::*;
76
import std::io::*;
87

9-
import rustc::driver::diagnostic;
10-
import rustc::syntax::ast;
11-
import rustc::syntax::codemap;
12-
import rustc::syntax::parse::parser;
13-
import rustc::syntax::print::*;
8+
import syntax::diagnostic;
9+
import syntax::ast;
10+
import syntax::codemap;
11+
import syntax::parse::parser;
12+
import syntax::print::*;
1413

1514
fn new_parse_sess() -> parser::parse_sess {
1615
fail;

src/test/run-pass/issue-1926.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// xfail-test
22
// fails pretty printing for some reason
3-
use rustc;
4-
import rustc::driver::diagnostic;
5-
import rustc::syntax;
6-
import rustc::syntax::ast;
7-
import rustc::syntax::codemap;
8-
import rustc::syntax::print::pprust;
9-
import rustc::syntax::parse::parser;
3+
use syntax(name = "rustsyntax");
4+
import syntax::diagnostic;
5+
import syntax;
6+
import syntax::ast;
7+
import syntax::codemap;
8+
import syntax::print::pprust;
9+
import syntax::parse::parser;
1010

1111
fn new_parse_sess() -> parser::parse_sess {
1212
let cm = codemap::new_codemap();

src/test/run-pass/qquote.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// xfail-pretty
22

33
use std;
4-
use rustc;
4+
use syntax(name = "rustsyntax");
55

6-
import rustc::*;
76
import io::*;
87

9-
import rustc::driver::diagnostic;
10-
import rustc::syntax::ast;
11-
import rustc::syntax::codemap;
12-
import rustc::syntax::parse;
13-
import rustc::syntax::print::*;
8+
import syntax::diagnostic;
9+
import syntax::ast;
10+
import syntax::codemap;
11+
import syntax::parse;
12+
import syntax::print::*;
1413

1514
fn new_parse_sess() -> parse::parse_sess {
1615
let cm = codemap::new_codemap();

0 commit comments

Comments
 (0)