Test container type is added.

Test container is planned to test codezero microkernel extensively.
With these changes, everything is there to develop a full-featured test suite.
It also exemplifies how a new container type can be added to the system.
(cherry picked from commit f21fa53df421bfc8eeeaa096c89b98beed436c60)
This commit is contained in:
Bora Sahin
2009-10-05 18:14:31 +03:00
committed by Bahadir Balban
parent 89d49ef495
commit 2a47e425c4
11 changed files with 214 additions and 1 deletions

View File

@@ -63,6 +63,21 @@ def build_posix_container(projpaths, container):
container_packer = DefaultContainerPacker(container, images)
return container_packer.pack_container()
# We simply use SCons to figure all this out from container.id
# Builds the test container.
def build_test_container(projpaths, container):
images = []
cwd = os.getcwd()
os.chdir(TESTDIR)
print '\nBuilding the Test Container...'
scons_cmd = 'scons ' + 'cont=' + str(container.id)
print "Issuing scons command: %s" % scons_cmd
os.system(scons_cmd)
builddir = source_to_builddir(TESTDIR, container.id)
os.path.walk(builddir, glob_by_walk, ['*.elf', images])
container_packer = DefaultContainerPacker(container, images)
return container_packer.pack_container()
# This simply calls SCons on a given container, and collects
# all images with .elf extension, instead of using whole classes
# for building and packing.
@@ -89,6 +104,8 @@ def build_all_containers():
cont_images.append(build_default_container(projpaths, container))
elif container.type == 'posix':
cont_images.append(build_posix_container(projpaths, container))
elif container.type == 'test':
cont_images.append(build_test_container(projpaths, container))
else:
print "Error: Don't know how to build " + \
"container of type: %s" % (container.type)