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,36 +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
- CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
503
- --compile-lib-path $$(HLIB$(1 ) _H_$(3 ) ) \
504
- --run-lib-path $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) \
505
- --rustc-path $$(HBIN$(1 ) _H_$(3 ) ) /rustc$$(X_$(3 ) ) \
506
- --aux-base $$(S ) src/test/auxiliary/ \
507
- --stage-id stage$(1 ) -$(2 ) \
508
- --host $(CFG_BUILD_TRIPLE ) \
509
- --target $(2 ) \
510
- --adb-path=$(CFG_ADB_PATH ) \
511
- --adb-test-dir=$(CFG_ADB_TEST_DIR ) \
512
- --rustcflags "$(RUSTC_FLAGS_$(2 ) ) $$(CFG_RUSTC_FLAGS ) --target=$(2 ) " \
513
- $$(CTEST_TESTARGS )
514
-
515
- else
516
-
517
417
CTEST_COMMON_ARGS$(1 ) -T-$(2 ) -H-$(3 ) := \
518
418
--compile-lib-path $$(HLIB$(1 ) _H_$(3 ) ) \
519
419
--run-lib-path $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) \
520
- --rustc-path $$(HBIN$(1 ) _H_$(3 ) ) /rustc$$(X_$(3 ) ) \
420
+ --rustc-path $$(HBIN$(1 ) _H_$(3 ) ) /rustc$$(X_$(3 ) ) \
521
421
--aux-base $$(S ) src/test/auxiliary/ \
522
422
--stage-id stage$(1 ) -$(2 ) \
523
- --host $(CFG_BUILD_TRIPLE ) \
524
- --target $(2 ) \
525
423
--rustcflags "$(RUSTC_FLAGS_$(2 ) ) $$(CFG_RUSTC_FLAGS ) --target=$(2 ) " \
526
424
$$(CTEST_TESTARGS )
527
425
528
- endif
529
-
530
426
CTEST_DEPS_rpass_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_TESTS )
531
427
CTEST_DEPS_rpass_full_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RPASS_FULL_TESTS ) $$(TLIBRUSTC_DEFAULT$(1 ) _T_$(2 ) _H_$(3 ) )
532
428
CTEST_DEPS_rfail_$(1 ) -T-$(2 ) -H-$(3 ) = $$(RFAIL_TESTS )
@@ -558,7 +454,7 @@ ifeq ($$(CTEST_DISABLE_$(4)),)
558
454
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
559
455
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
560
456
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
561
- @$$(call E, run $(4) [$(2)] : $$<)
457
+ @$$(call E, run $(4): $$<)
562
458
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
563
459
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
564
460
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
569
465
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
570
466
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
571
467
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
572
- @$$(call E, run $(4) [$(2)] : $$<)
468
+ @$$(call E, run $(4): $$<)
573
469
@$$(call E, warning: tests disabled: $$(CTEST_DISABLE_$(4)))
574
470
touch $$@
575
471
@@ -610,7 +506,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
610
506
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) : \
611
507
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
612
508
$$(PRETTY_DEPS_$(4 ) )
613
- @$$(call E, run pretty-rpass [ $( 2 ) ] : $$< )
509
+ @$$(call E, run pretty-rpass: $$< )
614
510
$$(Q )$$(call CFG_RUN_CTEST_$(2 ) ,$(1 ) ,$$< ,$(3 ) ) \
615
511
$$(PRETTY_ARGS$(1 ) -T-$(2 ) -H-$(3 ) -$(4 ) ) \
616
512
--logfile $$(call TEST_LOG_FILE,$(1 ) ,$(2 ) ,$(3 ) ,$(4 ) ) \
@@ -637,7 +533,7 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3)
637
533
$$(call TEST_OK_FILE,$(1 ) ,$(2 ) ,$(3 ) ,doc-$(4 ) ) : \
638
534
$$(TEST_SREQ$(1 ) _T_$(2 ) _H_$(3 ) ) \
639
535
doc-$(4 ) -extract$(3 )
640
- @$$(call E, run doc-$(4 ) [ $( 2 ) ] : $$< )
536
+ @$$(call E, run doc-$(4 ) : $$< )
641
537
$$(Q )$$(call CFG_RUN_CTEST_$(2 ) ,$(1 ) ,$$< ,$(3 ) ) \
642
538
$$(DOC_TEST_ARGS$(1 ) -T-$(2 ) -H-$(3 ) -doc-$(4 ) ) \
643
539
--logfile $$(call TEST_LOG_FILE,$(1 ) ,$(2 ) ,$(3 ) ,doc-$(4 ) ) \
0 commit comments