92
92
$(foreach target,$(CFG_TARGET_TRIPLES), \
93
93
$(eval $(call DEF_TARGET_COMMANDS,$(target))))
94
94
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
137
95
138
96
# #####################################################################
139
97
# Main test targets
@@ -361,52 +319,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
361
319
&& touch $$@
362
320
endef
363
321
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
-
397
322
$(foreach host,$(CFG_HOST_TRIPLES), \
398
323
$(foreach target,$(CFG_TARGET_TRIPLES), \
399
324
$(foreach stage,$(STAGES), \
400
325
$(foreach crate, $(TEST_CRATES), \
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
- ))))))
326
+ $(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate)))))))
410
327
411
328
412
329
# #####################################################################
@@ -497,35 +414,15 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
497
414
498
415
# Rules for the cfail/rfail/rpass/bench/perf test runner
499
416
500
- ifeq ($(CFG_ADB_DEVICE ) ,true)
501
-
502
417
CTEST_COMMON_ARGS$(1 ) -T-$(2 ) -H-$(3 ) := \
503
418
--compile-lib-path $$(HLIB$(1 ) _H_$(3 ) ) \
504
419
--run-lib-path $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) \
505
420
--rustc-path $$(HBIN$(1 ) _H_$(3 ) ) /rustc$$(X_$(3 ) ) \
506
421
--aux-base $$(S ) src/test/auxiliary/ \
507
422
--stage-id stage$(1 ) -$(2 ) \
508
- --host $(CFG_BUILD_TRIPLE ) \
509
- --target $(2 ) \
510
- --adb-path=$(CFG_ADB_PATH ) \
511
423
--rustcflags "$(RUSTC_FLAGS_$(2 ) ) $$(CFG_RUSTC_FLAGS ) --target=$(2 ) " \
512
424
$$(CTEST_TESTARGS )
513
425
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
-
529
426
CTEST_DEPS_rpass_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_TESTS )
530
427
CTEST_DEPS_rpass_full_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_FULL_TESTS ) $$(TLIBRUSTC_DEFAULT$(1 ) _T_$(2 ) _H_$(3 ) )
531
428
CTEST_DEPS_rfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RFAIL_TESTS )
@@ -557,7 +454,7 @@ ifeq ($$(CTEST_DISABLE_$(4)),)
557
454
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
558
455
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
559
456
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
560
- @$$(call E, run $(4) [$(2)] : $$<)
457
+ @$$(call E, run $(4): $$<)
561
458
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
562
459
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
563
460
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
568
465
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
569
466
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
570
467
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
571
- @$$(call E, run $(4) [$(2)] : $$<)
468
+ @$$(call E, run $(4): $$<)
572
469
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
573
470
touch $$@
574
471
@@ -609,7 +506,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
609
506
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
610
507
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
611
508
$$(PRETTY_DEPS_$(4 ) )
612
- @$$(call E, run pretty-rpass [ $( 2 ) ] : $$< )
509
+ @$$(call E, run pretty-rpass: $$< )
613
510
$$(Q )$$(call CFG_RUN_CTEST_$(2 ) ,$(1 ) ,$$< ,$(3 ) ) \
614
511
$$(PRETTY_ARGS$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) ) \
615
512
--logfile $$(call TEST_LOG_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) \
@@ -636,7 +533,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3)
636
533
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,doc-$(4 ) ) : \
637
534
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
638
535
doc-$(4 ) -extract$(3 )
639
- @$$(call E, run doc-$(4 ) [ $( 2 ) ] : $$< )
536
+ @$$(call E, run doc-$(4 ) : $$< )
640
537
$$(Q )$$(call CFG_RUN_CTEST_$(2 ) ,$(1 ) ,$$< ,$(3 ) ) \
641
538
$$(DOC_TEST_ARGS$(1 ) -T-$(2 ) -H-$(3 ) -doc-$(4 ) ) \
642
539
--logfile $$(call TEST_LOG_FILE,$(1 ) ,$(2 ) ,$(3 ) ,doc-$(4 ) ) \
0 commit comments