Search for profiling tools executable paths when they are required

This commit is contained in:
Cosmin Ștefan Ciocan
2024-02-02 14:40:29 +00:00
parent 26fab4d31e
commit ba775f7ce1
4 changed files with 131 additions and 8 deletions
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
echo "This is just used to test the path_utils.find_executable function"
+16
View File
@@ -0,0 +1,16 @@
import os
from nvcc4jupyter.path_utils import find_executable
def test_which():
assert find_executable("ls") == "/usr/bin/ls"
def test_find_executable(fixtures_path: str):
exec_path = find_executable("searchforme", [fixtures_path])
assert exec_path is not None
exec_dir, exec_fname = os.path.split(exec_path)
assert exec_fname == "searchforme"
assert os.path.basename(exec_dir) == "scripts"