diff options
| author | guozhanxin <[email protected]> | 2021-07-12 10:14:20 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2021-07-12 10:14:20 +0800 |
| commit | 40e7d5a23df65c15bb7db53fe5f77e76701fd20d (patch) | |
| tree | 4973b28b01d289dd596a097a7560f26b810db771 /tools/menuconfig.py | |
| parent | ddc5c793a482fe44310bafe181802ad406fa1b29 (diff) | |
| parent | 5bae565f7f021ab13113fc0a9c67fc468d97de02 (diff) | |
Merge remote-tracking branch 'remotes/gitee/master'
Diffstat (limited to 'tools/menuconfig.py')
| -rw-r--r-- | tools/menuconfig.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tools/menuconfig.py b/tools/menuconfig.py index c0a33718de..853e4fe7f8 100644 --- a/tools/menuconfig.py +++ b/tools/menuconfig.py @@ -217,8 +217,27 @@ def touch_env(): if os.path.exists(os.path.join(env_dir, 'tools', 'scripts')): os.environ["PATH"] = os.path.join(env_dir, 'tools', 'scripts') + ';' + os.environ["PATH"] +# Exclude utestcases +def exclude_utestcases(RTT_ROOT): + if os.path.isfile(os.path.join(RTT_ROOT, 'examples/utest/testcases/Kconfig')): + return + + if not os.path.isfile(os.path.join(RTT_ROOT, 'Kconfig')): + return + + with open(os.path.join(RTT_ROOT, 'Kconfig'), 'r') as f: + data = f.readlines() + with open(os.path.join(RTT_ROOT, 'Kconfig'), 'w') as f: + for line in data: + if line.find('examples/utest/testcases/Kconfig') == -1: + f.write(line) + # menuconfig for Linux def menuconfig(RTT_ROOT): + + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + kconfig_dir = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends') os.system('scons -C ' + kconfig_dir) @@ -250,6 +269,9 @@ def menuconfig(RTT_ROOT): def guiconfig(RTT_ROOT): import pyguiconfig + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + if sys.platform != 'win32': touch_env() @@ -260,7 +282,7 @@ def guiconfig(RTT_ROOT): fn = '.config' fn_old = '.config.old' - sys.argv = ['guiconfig', 'Kconfig']; + sys.argv = ['guiconfig', 'Kconfig'] pyguiconfig._main() if os.path.isfile(fn): @@ -281,6 +303,9 @@ def guiconfig(RTT_ROOT): def guiconfig_silent(RTT_ROOT): import defconfig + # Exclude utestcases + exclude_utestcases(RTT_ROOT) + if sys.platform != 'win32': touch_env() |
