Add labs: 59 Python lab scripts + tools + run_lab.sh
- labs/src/: 59 lab scripts covering OA API (Ch2-Ch25 + extras) - All C++ references removed, oapy-only documentation - labs/tools/: debug and test utilities - labs/run_lab.sh: lab runner with LD_PRELOAD and env setup
This commit is contained in:
20
labs/tools/_debug_path.py
Normal file
20
labs/tools/_debug_path.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, os
|
||||
__dir__ = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, os.path.join(__dir__, '..', 'build'))
|
||||
sys.path.insert(0, __dir__)
|
||||
print(f'cwd: {os.getcwd()}')
|
||||
print(f'__dir__: {__dir__}')
|
||||
print(f'abs path: {os.path.join(__dir__, "lab13_1_dir")}')
|
||||
from utils import init_oa, create_lib, make_oa_name, make_oa_string, get_namespace
|
||||
init_oa()
|
||||
ns = get_namespace('native')
|
||||
dirname = os.path.join(__dir__, "lab13_1_dir")
|
||||
print(f'Creating at: {dirname}')
|
||||
import shutil
|
||||
if os.path.exists(dirname):
|
||||
shutil.rmtree(dirname)
|
||||
sn_lib, lib = create_lib("lab13_1_lib", dirname)
|
||||
print(f'OK')
|
||||
lib.close()
|
||||
shutil.rmtree(dirname)
|
||||
Reference in New Issue
Block a user