Files
rk35xx-android14/external/autotest/client/tools/make_clean
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

34 lines
1.0 KiB
Python
Executable File

#!/usr/bin/python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
def purge_src(top_dir):
if not os.path.exists(top_dir):
return
for dir in os.listdir(top_dir):
if dir.startswith('.'):
continue
py = os.path.join (top_dir, dir, dir + '.py')
if not os.path.exists(py):
continue
ret = os.system('grep -q "preserve_srcdir = " ' + py)
src_path = os.path.abspath(os.path.join('tests', dir, 'src'))
if not os.path.exists(src_path):
continue
if ret: # This should have a replaceable src dir
cmd = 'rm -rf ' + src_path
else:
cmd = 'cd %s; make clean > /dev/null 2>&1 ' % src_path
print('Cleaning %s test dir' % dir)
os.system(cmd)
if os.path.isdir('tmp'):
os.system('cd tmp && ls -A | xargs rm -rf')
for dir in ['site_tests', 'site_profilers', 'tests', 'profilers', 'deps']:
purge_src(dir)