diff options
| author | Po Lu | 2025-03-16 20:14:32 +0800 |
|---|---|---|
| committer | Po Lu | 2025-03-16 20:14:34 +0800 |
| commit | 5d02ca181daa2b3833a2b32157388a7b131955e8 (patch) | |
| tree | 9cf6d2f78cc5dd36454bcbf54d17b85e4de2767c | |
| parent | 412a6fad98e768000dfe9538179889d6faeaa97a (diff) | |
| download | emacs-5d02ca181daa2b3833a2b32157388a7b131955e8.tar.gz emacs-5d02ca181daa2b3833a2b32157388a7b131955e8.zip | |
; New `bisect' argument to `ats-execute-tests-batch'
* test/infra/android/test-controller.el
(ats-execute-tests-batch): New argument `bisect'.
| -rw-r--r-- | test/infra/android/test-controller.el | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/test/infra/android/test-controller.el b/test/infra/android/test-controller.el index 7424518e11b..6e5350b43a3 100644 --- a/test/infra/android/test-controller.el +++ b/test/infra/android/test-controller.el | |||
| @@ -2537,7 +2537,13 @@ The following command-line arguments are also accepted: | |||
| 2537 | --stub-file Name of `stub.zip' wrapper required on Android <= 4.4. | 2537 | --stub-file Name of `stub.zip' wrapper required on Android <= 4.4. |
| 2538 | --test-dir Directory in which Emacs's tests are situated. | 2538 | --test-dir Directory in which Emacs's tests are situated. |
| 2539 | --output-dir, -o DIR Name of a directory into which to save test logs. | 2539 | --output-dir, -o DIR Name of a directory into which to save test logs. |
| 2540 | --no-upload Don't upload tests; only run those which already exist." | 2540 | --no-upload Don't upload tests; only run those which already exist. |
| 2541 | |||
| 2542 | In addition, these options exist to facilitate debugging the | ||
| 2543 | automated testing process itself. | ||
| 2544 | |||
| 2545 | --bisect COUNT Skip COUNT tests from the beginning to investigate | ||
| 2546 | compatibility issues between tests." | ||
| 2541 | (let* ((ats-adb-host (getenv "ATS_ADB_HOST")) | 2547 | (let* ((ats-adb-host (getenv "ATS_ADB_HOST")) |
| 2542 | (devices (ats-enumerate-devices | 2548 | (devices (ats-enumerate-devices |
| 2543 | (lambda (name state _) | 2549 | (lambda (name state _) |
| @@ -2547,7 +2553,8 @@ The following command-line arguments are also accepted: | |||
| 2547 | (cmd-device nil) | 2553 | (cmd-device nil) |
| 2548 | (cmd-user nil) | 2554 | (cmd-user nil) |
| 2549 | (cmd-output-dir nil) | 2555 | (cmd-output-dir nil) |
| 2550 | (cmd-no-upload nil)) | 2556 | (cmd-no-upload nil) |
| 2557 | (bisect 0)) | ||
| 2551 | ;; Read command-line arguments. | 2558 | ;; Read command-line arguments. |
| 2552 | (let (arg) | 2559 | (let (arg) |
| 2553 | (while (setq arg (pop argv)) | 2560 | (while (setq arg (pop argv)) |
| @@ -2568,7 +2575,13 @@ The following command-line arguments are also accepted: | |||
| 2568 | --stub-file Name of `stub.zip' wrapper required on Android <= 4.4. | 2575 | --stub-file Name of `stub.zip' wrapper required on Android <= 4.4. |
| 2569 | --test-dir Directory in which Emacs's tests are situated. | 2576 | --test-dir Directory in which Emacs's tests are situated. |
| 2570 | --output-dir, -o DIR Name of a directory into which to save test logs. | 2577 | --output-dir, -o DIR Name of a directory into which to save test logs. |
| 2571 | --no-upload Don't upload tests; only run those which already exist.") | 2578 | --no-upload Don't upload tests; only run those which already exist. |
| 2579 | |||
| 2580 | In addition, these options exist to facilitate debugging the | ||
| 2581 | automated testing process itself. | ||
| 2582 | |||
| 2583 | --bisect COUNT Skip COUNT tests from the beginning to investigate | ||
| 2584 | compatibility issues between tests.") | ||
| 2572 | (kill-emacs 0)) | 2585 | (kill-emacs 0)) |
| 2573 | ((or (equal arg "-s") (equal arg "--device")) | 2586 | ((or (equal arg "-s") (equal arg "--device")) |
| 2574 | (setq cmd-device | 2587 | (setq cmd-device |
| @@ -2597,6 +2610,17 @@ The following command-line arguments are also accepted: | |||
| 2597 | "Expected argument to `--test-dir' option.")))) | 2610 | "Expected argument to `--test-dir' option.")))) |
| 2598 | ((equal arg "--no-upload") | 2611 | ((equal arg "--no-upload") |
| 2599 | (setq cmd-no-upload t)) | 2612 | (setq cmd-no-upload t)) |
| 2613 | ((equal arg "--bisect") | ||
| 2614 | (let ((value (or (pop argv) | ||
| 2615 | (ats-cmd-error | ||
| 2616 | "Expected argument to `--bisect' option.")))) | ||
| 2617 | (setq bisect (progn | ||
| 2618 | (unless (string-match-p | ||
| 2619 | "\\`[[:digit:]]+\\'" value) | ||
| 2620 | (ats-cmd-error | ||
| 2621 | "Invalid value for `--bisect' option: `%s'" | ||
| 2622 | value)) | ||
| 2623 | (string-to-number value))))) | ||
| 2600 | (t (ats-cmd-error "Unknown command line argument `%s'" arg))))) | 2624 | (t (ats-cmd-error "Unknown command line argument `%s'" arg))))) |
| 2601 | ;; Validate and apply command-line arguments or prompt the user for | 2625 | ;; Validate and apply command-line arguments or prompt the user for |
| 2602 | ;; parameters in their absence. | 2626 | ;; parameters in their absence. |
| @@ -2625,10 +2649,11 @@ The following command-line arguments are also accepted: | |||
| 2625 | (user nil)) | 2649 | (user nil)) |
| 2626 | (if cmd-user | 2650 | (if cmd-user |
| 2627 | (progn | 2651 | (progn |
| 2628 | (let ((valid-number (string-match-p "^[[:digit:]]+$" cmd-user)) | 2652 | (let ((valid-number |
| 2653 | (string-match-p "\\`[[:digit:]]+\\'" cmd-user)) | ||
| 2629 | (uid (string-to-number cmd-user))) | 2654 | (uid (string-to-number cmd-user))) |
| 2630 | (unless valid-number | 2655 | (unless valid-number |
| 2631 | (ats-cmd-error "Invalid value for `--user' argument: %s" | 2656 | (ats-cmd-error "Invalid value for `--user' argument: `'%s'" |
| 2632 | cmd-user)) | 2657 | cmd-user)) |
| 2633 | (unless (assq uid users) | 2658 | (unless (assq uid users) |
| 2634 | (ats-cmd-error "No such user exists: %d" uid)) | 2659 | (ats-cmd-error "No such user exists: %d" uid)) |
| @@ -2655,8 +2680,9 @@ The following command-line arguments are also accepted: | |||
| 2655 | (read-directory-name | 2680 | (read-directory-name |
| 2656 | "Where to save test log files? ")))) | 2681 | "Where to save test log files? ")))) |
| 2657 | (mkdir output-directory t) | 2682 | (mkdir output-directory t) |
| 2658 | (let ((tests (ats-list-tests connection))) | 2683 | (let* ((tests (ats-list-tests connection)) |
| 2659 | (dolist (test tests) | 2684 | (start (nthcdr bisect tests))) |
| 2685 | (dolist (test start) | ||
| 2660 | (message "Generating `%s/%s-test.log'" | 2686 | (message "Generating `%s/%s-test.log'" |
| 2661 | output-directory test) | 2687 | output-directory test) |
| 2662 | (ats-run-test connection test) | 2688 | (ats-run-test connection test) |