* checking for "config" file existence.
@ 2020-11-12 17:40 Jeffrin Jose T
2020-11-16 18:32 ` Shuah Khan
0 siblings, 1 reply; 3+ messages in thread
From: Jeffrin Jose T @ 2020-11-12 17:40 UTC (permalink / raw)
To: Shuah Khan; +Cc: lkml, open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 334 bytes --]
hello,
i wrote a small program to check for the existence of "config" files
for testing projects under kselftest framework.
chmod 755 test_config.py
This file should be located in "tools/testing/selftests"
This can be run as "./test_config.py"
--
software engineer
rajagiri school of engineering and technology - autonomous
[-- Attachment #2: test_config.py --]
[-- Type: text/x-python3, Size: 554 bytes --]
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 RSET
import os
from pathlib import Path
ok = 0
notok = 0
for filename in os.listdir():
fileall = Path("./"+filename)
filecheck = Path("./"+filename+"/"+"config")
if (fileall.is_dir()) and (filename != "kselftest"):
if filecheck.exists():
print(filename," [PASS]\n")
ok = ok + 1
else:
print(filename," [FAIL]\n")
notok = notok + 1
print(ok+notok,"TESTED")
print(ok, "PASSED")
print(notok,"FAILED")
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checking for "config" file existence.
2020-11-12 17:40 checking for "config" file existence Jeffrin Jose T
@ 2020-11-16 18:32 ` Shuah Khan
2020-11-16 19:10 ` Jeffrin Jose T
0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2020-11-16 18:32 UTC (permalink / raw)
To: Jeffrin Jose T, Shuah Khan; +Cc: lkml, open list:KERNEL SELFTEST FRAMEWORK
On 11/12/20 10:40 AM, Jeffrin Jose T wrote:
> hello,
>
> i wrote a small program to check for the existence of "config" files
> for testing projects under kselftest framework.
>
> chmod 755 test_config.py
> This file should be located in "tools/testing/selftests"
> This can be run as "./test_config.py"
>
Why do we need a dedicated script when you can do it with:
cd tools/testing/selftests; find . -name config
I see that your script also prints if config doesn't exist.
It is not a failure not have config as config is necessary
only when a test has config option dependencies.
What does this script attempting to solve?
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: checking for "config" file existence.
2020-11-16 18:32 ` Shuah Khan
@ 2020-11-16 19:10 ` Jeffrin Jose T
0 siblings, 0 replies; 3+ messages in thread
From: Jeffrin Jose T @ 2020-11-16 19:10 UTC (permalink / raw)
To: Shuah Khan, Shuah Khan; +Cc: lkml, open list:KERNEL SELFTEST FRAMEWORK
On Mon, 2020-11-16 at 11:32 -0700, Shuah Khan wrote:
> On 11/12/20 10:40 AM, Jeffrin Jose T wrote:
> > hello,
> >
> > i wrote a small program to check for the existence of "config"
> > files
> > for testing projects under kselftest framework.
> >
> > chmod 755 test_config.py
> > This file should be located in "tools/testing/selftests"
> > This can be run as "./test_config.py"
> >
> Why do we need a dedicated script when you can do it with:
>
> cd tools/testing/selftests; find . -name config
>
> I see that your script also prints if config doesn't exist.
> It is not a failure not have config as config is necessary
> only when a test has config option dependencies.
>
> What does this script attempting to solve?
according to what you said this script may not be necessary
thanks for the explanation :)
--
software engineer
rajagiri school of engineering and technology - autonomous
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-16 19:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 17:40 checking for "config" file existence Jeffrin Jose T
2020-11-16 18:32 ` Shuah Khan
2020-11-16 19:10 ` Jeffrin Jose T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).