diff mbox series

[V1,5/7] power_telemetry: support meson

Message ID 20200915083351.12506-6-yufengx.mo@intel.com (mailing list archive)
State Changes Requested
Headers show
Series power: power suite series support meson | expand

Commit Message

Yufen Mo Sept. 15, 2020, 8:33 a.m. UTC
support meson build.

Signed-off-by: yufengmx <yufengx.mo@intel.com>
---
 tests/TestSuite_power_telemetry.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/TestSuite_power_telemetry.py b/tests/TestSuite_power_telemetry.py
index 90404e3..8299d3b 100644
--- a/tests/TestSuite_power_telemetry.py
+++ b/tests/TestSuite_power_telemetry.py
@@ -42,6 +42,8 @@  import json
 from copy import deepcopy
 from pprint import pformat
 
+from settings import load_global_setting
+from settings import HOST_BUILD_TYPE_SETTING
 from utils import create_mask as dts_create_mask
 from settings import HEADER_SIZE
 from test_case import TestCase
@@ -126,15 +128,24 @@  class TestPowerTelemetry(TestCase):
         if self.dut.skip_setup:
             return
         SW = "CONFIG_RTE_LIBRTE_TELEMETRY"
-        cmd = "sed -i -e 's/{0}=n$/{0}=y/' {1}/config/common_base".format(
-            SW, self.target_dir)
-        self.d_a_con(cmd)
+        if 'meson' == load_global_setting(HOST_BUILD_TYPE_SETTING):
+            self.dut.set_build_options({SW[7:]: 'y'})
+        else:
+            cmd = "sed -i -e 's/{0}=n$/{0}=y/' {1}/config/common_base".format(
+                SW, self.target_dir)
+            self.d_a_con(cmd)
         # re-compile dpdk source code
+        back = self.dut.skip_setup
+        self.dut.skip_setup = False
         self.dut.build_install_dpdk(self.target)
+        self.dut.skip_setup = back
 
     def prepare_binary(self, name):
         example_dir = "examples/" + name
         out = self.dut.build_dpdk_apps('./' + example_dir)
+        if 'meson' == load_global_setting(HOST_BUILD_TYPE_SETTING):
+            return os.path.join(self.target_dir,
+                                self.dut.apps_name[os.path.basename(name)])
         self.verify("Error" not in out, "Compilation error")
         self.verify("No such" not in out, "Compilation error")
         binary_dir = os.path.join(self.target_dir, example_dir, 'build')