Restructure to keep __main__ free to be used when using codegen as part

of another project
This commit is contained in:
Abdelrahman Said 2025-03-02 11:58:25 +00:00
parent acaae99107
commit 87abfe8900
4 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
from .codegen import test_str8, test_doubly_linked_list, test_typed_array def main():
pass
if __name__ == "__main__": if __name__ == "__main__":
test_str8() main()
test_typed_array()
test_doubly_linked_list()

6
codegen/dev_main.py Normal file
View File

@ -0,0 +1,6 @@
from .codegen_example import test_str8, test_doubly_linked_list, test_typed_array
if __name__ == "__main__":
test_str8()
test_typed_array()
test_doubly_linked_list()

2
run
View File

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
python3 -m codegen python3 -m codegen.dev_main