forked from KolibriOS/kolibrios
[KERNEL][TEST] Embrase test code
git-svn-id: svn://kolibrios.org@9313 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f4d71d2b55
commit
16fd3a9980
@ -75,36 +75,36 @@ def check_tools(tools):
|
|||||||
draw_line()
|
draw_line()
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
# Check available tools
|
# Check available tools
|
||||||
tools = (("mcopy", "mtools"),
|
tools = (("mcopy", "mtools"),
|
||||||
("qemu-system-i386", "qemu-system-x86"),
|
("qemu-system-i386", "qemu-system-x86"),
|
||||||
("wget", "wget"),
|
("wget", "wget"),
|
||||||
("fasm", "fasm"))
|
("fasm", "fasm"))
|
||||||
check_tools(tools)
|
check_tools(tools)
|
||||||
|
|
||||||
# Get IMG
|
# Get IMG
|
||||||
if not os.path.exists("kolibri_test.img"):
|
if not os.path.exists("kolibri_test.img"):
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
execute("wget -q --show-progress http://builds.kolibrios.org/eng/data/data/kolibri.img -O kolibri_test.img")
|
execute("wget -q --show-progress http://builds.kolibrios.org/eng/data/data/kolibri.img -O kolibri_test.img")
|
||||||
else:
|
else:
|
||||||
builds_eng = sys.argv[1]
|
builds_eng = sys.argv[1]
|
||||||
execute(f"cp {builds_eng}/data/data/kolibri.img kolibri_test.img")
|
execute(f"cp {builds_eng}/data/data/kolibri.img kolibri_test.img")
|
||||||
|
|
||||||
# Remove old kernel (may fail if we removed it before so no check here)
|
# Remove old kernel (may fail if we removed it before so no check here)
|
||||||
os.system("mdel -i kolibri_test.img ::kernel.mnt > /dev/null")
|
os.system("mdel -i kolibri_test.img ::kernel.mnt > /dev/null")
|
||||||
|
|
||||||
# Check free space after kernel remove
|
# Check free space after kernel remove
|
||||||
free_clusters = int(subprocess.check_output("mdu -i kolibri_test.img :: -s", shell=True).split()[-1])
|
free_clusters = int(subprocess.check_output("mdu -i kolibri_test.img :: -s", shell=True).split()[-1])
|
||||||
floppy_image_clusters = 2880
|
floppy_image_clusters = 2880
|
||||||
if floppy_image_clusters - free_clusters < 500:
|
if floppy_image_clusters - free_clusters < 500:
|
||||||
# Remove unuseful files from IMG if lesser than 500 sectors
|
# Remove unuseful files from IMG if lesser than 500 sectors
|
||||||
execute("mdeltree -i kolibri_test.img ::GAMES", mute = True)
|
execute("mdeltree -i kolibri_test.img ::GAMES", mute = True)
|
||||||
execute("mdeltree -i kolibri_test.img ::DEMOS", mute = True)
|
execute("mdeltree -i kolibri_test.img ::DEMOS", mute = True)
|
||||||
execute("mdeltree -i kolibri_test.img ::3D", mute = True)
|
execute("mdeltree -i kolibri_test.img ::3D", mute = True)
|
||||||
|
|
||||||
# Get test kernel
|
# Get test kernel
|
||||||
if not os.path.exists("kernel.mnt.pretest"):
|
if not os.path.exists("kernel.mnt.pretest"):
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
with open("lang.inc", "w") as lang_inc:
|
with open("lang.inc", "w") as lang_inc:
|
||||||
lang_inc.write("lang fix en\n")
|
lang_inc.write("lang fix en\n")
|
||||||
@ -114,11 +114,11 @@ if not os.path.exists("kernel.mnt.pretest"):
|
|||||||
builds_eng = sys.argv[1]
|
builds_eng = sys.argv[1]
|
||||||
execute(f"cp {builds_eng}/data/kernel/trunk/kernel.mnt.pretest kernel.mnt.pretest", mute = True)
|
execute(f"cp {builds_eng}/data/kernel/trunk/kernel.mnt.pretest kernel.mnt.pretest", mute = True)
|
||||||
|
|
||||||
# Put the kernel into IMG
|
# Put the kernel into IMG
|
||||||
execute("mcopy -D o -i kolibri_test.img kernel.mnt.pretest ::kernel.mnt", mute = True)
|
execute("mcopy -D o -i kolibri_test.img kernel.mnt.pretest ::kernel.mnt", mute = True)
|
||||||
|
|
||||||
# Collect tests from test folder (not recursively yet)
|
# Collect tests from test folder (not recursively yet)
|
||||||
for test_folder in os.listdir("test"):
|
for test_folder in os.listdir("test"):
|
||||||
test_folder_path = f"test/{test_folder}"
|
test_folder_path = f"test/{test_folder}"
|
||||||
test_file = f"{test_folder_path}/test.py"
|
test_file = f"{test_folder_path}/test.py"
|
||||||
|
|
||||||
@ -128,9 +128,9 @@ for test_folder in os.listdir("test"):
|
|||||||
if os.path.exists(test_file):
|
if os.path.exists(test_file):
|
||||||
tests.append(test_folder_path)
|
tests.append(test_folder_path)
|
||||||
|
|
||||||
# Execute each test
|
# Execute each test
|
||||||
test_number = 1
|
test_number = 1
|
||||||
for test in tests:
|
for test in tests:
|
||||||
test_dir = f"{root_dir}/{test}"
|
test_dir = f"{root_dir}/{test}"
|
||||||
|
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user