about summary refs log tree commit diff
path: root/pkgs/tools/misc/esptool/test-call-bin-directly.patch
blob: b7d77278009038f26057ef6798eaf318fccd6903 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
diff --git a/test/test_espsecure.py b/test/test_espsecure.py
index 25b0b87..627005c 100755
--- a/test/test_espsecure.py
+++ b/test/test_espsecure.py
@@ -35,7 +35,7 @@ class EspSecureTestCase:
         Returns output as a string if there is any,
         raises an exception if espsecure.py fails
         """
-        cmd = [sys.executable, ESPSECURE_PY] + args.split(" ")
+        cmd = [ESPSECURE_PY] + args.split(" ")
         print("\nExecuting {}...".format(" ".join(cmd)))
 
         try:
diff --git a/test/test_esptool.py b/test/test_esptool.py
index 042a1ce..b294e26 100755
--- a/test/test_esptool.py
+++ b/test/test_esptool.py
@@ -57,7 +57,10 @@ try:
     ESPTOOL_PY = os.environ["ESPTOOL_PY"]
 except KeyError:
     ESPTOOL_PY = os.path.join(TEST_DIR, "..", "esptool/__init__.py")
-ESPSECURE_PY = os.path.join(TEST_DIR, "..", "espsecure/__init__.py")
+try:
+    ESPSECURE_PY = os.environ["ESPSECURE_PY"]
+except KeyError:
+    ESPSECURE_PY = os.path.join(TEST_DIR, "..", "espsecure/__init__.py")
 ESPRFC2217SERVER_PY = os.path.join(TEST_DIR, "..", "esp_rfc2217_server.py")
 
 RETURN_CODE_FATAL_ERROR = 2
@@ -74,7 +77,6 @@ class ESPRFC2217Server(object):
     def __init__(self, rfc2217_port=None):
         self.port = rfc2217_port or self.get_free_port()
         self.cmd = [
-            sys.executable,
             ESPRFC2217SERVER_PY,
             "-p",
             str(self.port),
@@ -130,7 +132,7 @@ class ESPRFC2217Server(object):
 class EsptoolTestCase:
     def run_espsecure(self, args):
 
-        cmd = [sys.executable, ESPSECURE_PY] + args.split(" ")
+        cmd = [ESPSECURE_PY] + args.split(" ")
         print("\nExecuting {}...".format(" ".join(cmd)))
         try:
             output = subprocess.check_output(
@@ -155,7 +157,7 @@ class EsptoolTestCase:
         Raises an exception if esptool.py fails.
         """
         trace_args = ["--trace"] if arg_trace else []
-        cmd = [sys.executable, ESPTOOL_PY] + trace_args
+        cmd = [ESPTOOL_PY] + trace_args
         if chip_name or arg_chip is not None and chip_name != "auto":
             cmd += ["--chip", chip_name or arg_chip]
         if rfc2217_port or arg_port is not None:
diff --git a/test/test_imagegen.py b/test/test_imagegen.py
index a1feec2..01bd59c 100755
--- a/test/test_imagegen.py
+++ b/test/test_imagegen.py
@@ -108,7 +108,7 @@ class BaseTestCase:
         Run esptool.py image_info on a binary file,
         assert no red flags about contents.
         """
-        cmd = [sys.executable, ESPTOOL_PY, "--chip", chip, "image_info", binpath]
+        cmd = [ESPTOOL_PY, "--chip", chip, "image_info", binpath]
         try:
             output = subprocess.check_output(cmd)
             output = output.decode("utf-8")
@@ -123,7 +123,7 @@ class BaseTestCase:
 
     def run_elf2image(self, chip, elf_path, version=None, extra_args=[]):
         """Run elf2image on elf_path"""
-        cmd = [sys.executable, ESPTOOL_PY, "--chip", chip, "elf2image"]
+        cmd = [ESPTOOL_PY, "--chip", chip, "elf2image"]
         if version is not None:
             cmd += ["--version", str(version)]
         cmd += [elf_path] + extra_args
diff --git a/test/test_merge_bin.py b/test/test_merge_bin.py
index 8230069..2df5f8c 100755
--- a/test/test_merge_bin.py
+++ b/test/test_merge_bin.py
@@ -39,7 +39,6 @@ class TestMergeBin:
             output_file.close()
 
             cmd = [
-                sys.executable,
                 ESPTOOL_PY,
                 "--chip",
                 chip,