mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In normal cases, adb_clean.py cleaning the temporal directory is a good idea because all the tests run in a clean state, and previous executions do not influence the current one. However, when iterating and running only one or two tests with utils/run-test, removing all the artifacts and uploading them to the device can turn each iteration into waiting a couple of minutes. Since the changes in between tests should only touch a couple of libraries (or none at all, if the test itself is the modification), avoiding a full clean is beneficial. The commit modifies `adb_clean.py` to allow providing the environment variable `SKIP_ANDROID_CLEAN`, which will simply not execute the script. Since the introduction of #24146, only the modified artifacts will be uploaded, and the test iteration can be very fast (including no time, if there are no changes).
21 lines
631 B
Python
21 lines
631 B
Python
#!/usr/bin/env python
|
|
# adb_reboot.py - Reboots and cleans an Android device. -*- python -*-
|
|
#
|
|
# This source file is part of the Swift.org open source project
|
|
#
|
|
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
# Licensed under Apache License v2.0 with Runtime Library Exception
|
|
#
|
|
# See https://swift.org/LICENSE.txt for license information
|
|
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
|
|
import os
|
|
|
|
from adb.commands import DEVICE_TEMP_DIR, reboot, rmdir
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if 'SKIP_ANDROID_CLEAN' not in os.environ:
|
|
reboot()
|
|
rmdir(DEVICE_TEMP_DIR)
|