Files
linux-kernel-module-cheat/example_properties.py
Ciro Santilli 六四事件 法轮功 81a2ba927f userland: build really truly working now
userland test: start work, in a working state, but no features
2019-05-05 00:00:00 +00:00

34 lines
913 B
Python

#!/usr/bin/env python3
class ExecutableProperties:
'''
Encodes properties of userland and baremetal examples.
For directories, it applies to all files under the directory.
Used to determine how to build and test the examples.
'''
def __init__(
self,
exit_status=0,
interactive=False,
more_than_1s=False,
):
self.exit_status = exit_status
self.interactive = interactive
self.more_than_1s = more_than_1s
def should_be_tested(self):
return \
not self.interactive and \
not self.more_than_1s
executable_properties = {
'c/assert_fail.c': ExecutableProperties(exit_status=0),
'c/false.c': ExecutableProperties(exit_status=0),
}
def get(test_path):
if test_path in executable_properties:
return executable_properties[test_path]
else:
return ExecutableProperties()