def test_klinux_prefix(self):
   prefix_string = 'test_prefix'
   set_klinux_prefix(prefix_string)
   self.assertEqual(
       get_klinux_prefix(),
       'const char klinux_prefix[] = "{}";\n'.format(prefix_string))
Ejemplo n.º 2
0
# limitations under the License.
#
#
"""Declares the include files and symbols to be processed by the code generator.

Describes the types that need to be generated with the default values on the
target implementation. For each type, only include the values/members that are
present in newlib as well as the target host library.
"""

from asylo.platform.system_call.type_conversions.types_parse_functions import define_constants
from asylo.platform.system_call.type_conversions.types_parse_functions import define_struct
from asylo.platform.system_call.type_conversions.types_parse_functions import set_klinux_prefix
from asylo.platform.system_call.type_conversions.types_parse_functions import write_output

set_klinux_prefix("kLinux")

define_constants(name="FileStatusFlag",
                 values=[
                     "O_RDONLY", "O_WRONLY", "O_RDWR", "O_CREAT", "O_APPEND",
                     "O_EXCL", "O_TRUNC", "O_NONBLOCK", "O_DIRECT", "O_CLOEXEC"
                 ],
                 include_header_file="fcntl.h",
                 multi_valued=True)

define_constants(name="FileModeFlag",
                 values=[
                     "S_IFMT", "S_IFDIR", "S_IFCHR", "S_IFBLK", "S_IFREG",
                     "S_IFIFO", "S_IFLNK", "S_IFSOCK", "S_ISUID", "S_ISGID",
                     "S_ISVTX", "S_IRUSR", "S_IWUSR", "S_IXUSR", "S_IRGRP",
                     "S_IWGRP", "S_IXGRP", "S_IRWXG", "S_IROTH", "S_IWOTH",