diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 101 |
1 files changed, 63 insertions, 38 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index b92f017b81..2b7c02ec6a 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -13,6 +13,7 @@ import glob | |||
13 | import fnmatch | 13 | import fnmatch |
14 | import unittest | 14 | import unittest |
15 | import json | 15 | import json |
16 | import logging | ||
16 | 17 | ||
17 | from oeqa.selftest.case import OESelftestTestCase | 18 | from oeqa.selftest.case import OESelftestTestCase |
18 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer | 19 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer |
@@ -2523,6 +2524,13 @@ class DevtoolUpgradeTests(DevtoolBase): | |||
2523 | 2524 | ||
2524 | 2525 | ||
2525 | class DevtoolIdeSdkTests(DevtoolBase): | 2526 | class DevtoolIdeSdkTests(DevtoolBase): |
2527 | |||
2528 | def setUp(self): | ||
2529 | super().setUp() | ||
2530 | self._cmd_logger = None | ||
2531 | if self.logger.isEnabledFor(logging.DEBUG): | ||
2532 | self._cmd_logger = self.logger | ||
2533 | |||
2526 | def _write_bb_config(self, recipe_names): | 2534 | def _write_bb_config(self, recipe_names): |
2527 | """Helper to write the bitbake local.conf file""" | 2535 | """Helper to write the bitbake local.conf file""" |
2528 | conf_lines = [ | 2536 | conf_lines = [ |
@@ -2562,7 +2570,8 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2562 | self.track_for_cleanup(tempdir) | 2570 | self.track_for_cleanup(tempdir) |
2563 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe_name) | 2571 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe_name) |
2564 | 2572 | ||
2565 | result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir)) | 2573 | result = runCmd('devtool modify %s -x %s --debug-build' % (recipe_name, tempdir), |
2574 | output_log=self._cmd_logger) | ||
2566 | self.assertExists(os.path.join(tempdir, build_file), | 2575 | self.assertExists(os.path.join(tempdir, build_file), |
2567 | 'Extracted source could not be found') | 2576 | 'Extracted source could not be found') |
2568 | self.assertExists(os.path.join(self.workspacedir, 'conf', | 2577 | self.assertExists(os.path.join(self.workspacedir, 'conf', |
@@ -2572,7 +2581,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2572 | self.assertTrue(matches, 'bbappend not created %s' % result.output) | 2581 | self.assertTrue(matches, 'bbappend not created %s' % result.output) |
2573 | 2582 | ||
2574 | # Test devtool status | 2583 | # Test devtool status |
2575 | result = runCmd('devtool status') | 2584 | result = runCmd('devtool status', output_log=self._cmd_logger) |
2576 | self.assertIn(recipe_name, result.output) | 2585 | self.assertIn(recipe_name, result.output) |
2577 | self.assertIn(tempdir, result.output) | 2586 | self.assertIn(tempdir, result.output) |
2578 | self._check_src_repo(tempdir) | 2587 | self._check_src_repo(tempdir) |
@@ -2628,7 +2637,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2628 | self._workspace_scripts_dir(recipe_name), i_and_d_script) | 2637 | self._workspace_scripts_dir(recipe_name), i_and_d_script) |
2629 | self.assertExists(install_deploy_cmd, | 2638 | self.assertExists(install_deploy_cmd, |
2630 | '%s script not found' % install_deploy_cmd) | 2639 | '%s script not found' % install_deploy_cmd) |
2631 | runCmd(install_deploy_cmd) | 2640 | runCmd(install_deploy_cmd, output_log=self._cmd_logger) |
2632 | 2641 | ||
2633 | MAGIC_STRING_ORIG = "Magic: 123456789" | 2642 | MAGIC_STRING_ORIG = "Magic: 123456789" |
2634 | MAGIC_STRING_NEW = "Magic: 987654321" | 2643 | MAGIC_STRING_NEW = "Magic: 987654321" |
@@ -2661,7 +2670,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2661 | cpp_code = cpp_code.replace(MAGIC_STRING_ORIG, MAGIC_STRING_NEW) | 2670 | cpp_code = cpp_code.replace(MAGIC_STRING_ORIG, MAGIC_STRING_NEW) |
2662 | with open(cpp_example_lib_hpp, 'w') as file: | 2671 | with open(cpp_example_lib_hpp, 'w') as file: |
2663 | file.write(cpp_code) | 2672 | file.write(cpp_code) |
2664 | runCmd(install_deploy_cmd, cwd=tempdir) | 2673 | runCmd(install_deploy_cmd, cwd=tempdir, output_log=self._cmd_logger) |
2665 | 2674 | ||
2666 | # Verify the modified example prints the modified magic string | 2675 | # Verify the modified example prints the modified magic string |
2667 | status, output = qemu.run(example_exe) | 2676 | status, output = qemu.run(example_exe) |
@@ -2688,7 +2697,8 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2688 | 2697 | ||
2689 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", gdb_recipe) | 2698 | native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", gdb_recipe) |
2690 | r = runCmd("%s --version" % gdb_binary, | 2699 | r = runCmd("%s --version" % gdb_binary, |
2691 | native_sysroot=native_sysroot, target_sys=target_sys) | 2700 | native_sysroot=native_sysroot, target_sys=target_sys, |
2701 | output_log=self._cmd_logger) | ||
2692 | self.assertEqual(r.status, 0) | 2702 | self.assertEqual(r.status, 0) |
2693 | self.assertIn("GNU gdb", r.output) | 2703 | self.assertIn("GNU gdb", r.output) |
2694 | 2704 | ||
@@ -2716,18 +2726,20 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2716 | recipe_name), 'gdb_1234_usr-bin-' + example_exe) | 2726 | recipe_name), 'gdb_1234_usr-bin-' + example_exe) |
2717 | 2727 | ||
2718 | # Start a gdbserver | 2728 | # Start a gdbserver |
2719 | r = runCmd(gdbserver_script) | 2729 | r = runCmd(gdbserver_script, output_log=self._cmd_logger) |
2720 | self.assertEqual(r.status, 0) | 2730 | self.assertEqual(r.status, 0) |
2721 | 2731 | ||
2722 | # Check there is a gdbserver running | 2732 | # Check there is a gdbserver running |
2723 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) | 2733 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), |
2734 | output_log=self._cmd_logger) | ||
2724 | self.assertEqual(r.status, 0) | 2735 | self.assertEqual(r.status, 0) |
2725 | self.assertIn("gdbserver ", r.output) | 2736 | self.assertIn("gdbserver ", r.output) |
2726 | 2737 | ||
2727 | # Check the pid file is correct | 2738 | # Check the pid file is correct |
2728 | test_cmd = "cat /proc/$(cat /tmp/gdbserver_1234_usr-bin-" + \ | 2739 | test_cmd = "cat /proc/$(cat /tmp/gdbserver_1234_usr-bin-" + \ |
2729 | example_exe + "/pid)/cmdline" | 2740 | example_exe + "/pid)/cmdline" |
2730 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd)) | 2741 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, test_cmd), |
2742 | output_log=self._cmd_logger) | ||
2731 | self.assertEqual(r.status, 0) | 2743 | self.assertEqual(r.status, 0) |
2732 | self.assertIn("gdbserver", r.output) | 2744 | self.assertIn("gdbserver", r.output) |
2733 | 2745 | ||
@@ -2738,7 +2750,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2738 | gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string | 2750 | gdb_batch_cmd += " -ex 'print CppExample::test_string.compare(\"cpp-example-lib %saaa\")'" % magic_string |
2739 | gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:13,13'" | 2751 | gdb_batch_cmd += " -ex 'list cpp-example-lib.hpp:13,13'" |
2740 | gdb_batch_cmd += " -ex 'continue'" | 2752 | gdb_batch_cmd += " -ex 'continue'" |
2741 | r = runCmd(gdb_script + gdb_batch_cmd) | 2753 | r = runCmd(gdb_script + gdb_batch_cmd, output_log=self._cmd_logger) |
2742 | self.logger.debug("%s %s returned: %s", gdb_script, | 2754 | self.logger.debug("%s %s returned: %s", gdb_script, |
2743 | gdb_batch_cmd, r.output) | 2755 | gdb_batch_cmd, r.output) |
2744 | self.assertEqual(r.status, 0) | 2756 | self.assertEqual(r.status, 0) |
@@ -2750,11 +2762,11 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2750 | self.assertIn("exited normally", r.output) | 2762 | self.assertIn("exited normally", r.output) |
2751 | 2763 | ||
2752 | # Stop the gdbserver | 2764 | # Stop the gdbserver |
2753 | r = runCmd(gdbserver_script + ' stop') | 2765 | r = runCmd(gdbserver_script + ' stop', output_log=self._cmd_logger) |
2754 | self.assertEqual(r.status, 0) | 2766 | self.assertEqual(r.status, 0) |
2755 | 2767 | ||
2756 | # Check there is no gdbserver running | 2768 | # Check there is no gdbserver running |
2757 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps')) | 2769 | r = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 'ps'), output_log=self._cmd_logger) |
2758 | self.assertEqual(r.status, 0) | 2770 | self.assertEqual(r.status, 0) |
2759 | self.assertNotIn("gdbserver ", r.output) | 2771 | self.assertNotIn("gdbserver ", r.output) |
2760 | 2772 | ||
@@ -2775,29 +2787,29 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2775 | self.assertExists(cmake_exe) | 2787 | self.assertExists(cmake_exe) |
2776 | 2788 | ||
2777 | # Verify the cmake preset generated by devtool ide-sdk is available | 2789 | # Verify the cmake preset generated by devtool ide-sdk is available |
2778 | result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir) | 2790 | result = runCmd('%s --list-presets' % cmake_exe, cwd=tempdir, output_log=self._cmd_logger) |
2779 | self.assertIn(preset_name, result.output) | 2791 | self.assertIn(preset_name, result.output) |
2780 | 2792 | ||
2781 | # Verify cmake re-uses the o files compiled by bitbake | 2793 | # Verify cmake re-uses the o files compiled by bitbake |
2782 | result = runCmd('%s --build --preset %s' % | 2794 | result = runCmd('%s --build --preset %s' % |
2783 | (cmake_exe, preset_name), cwd=tempdir) | 2795 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) |
2784 | self.assertIn("ninja: no work to do.", result.output) | 2796 | self.assertIn("ninja: no work to do.", result.output) |
2785 | 2797 | ||
2786 | # Verify the unit tests work (in Qemu user mode) | 2798 | # Verify the unit tests work (in Qemu user mode) |
2787 | result = runCmd('%s --build --preset %s --target test' % | 2799 | result = runCmd('%s --build --preset %s --target test' % |
2788 | (cmake_exe, preset_name), cwd=tempdir) | 2800 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) |
2789 | self.assertIn("100% tests passed", result.output) | 2801 | self.assertIn("100% tests passed", result.output) |
2790 | 2802 | ||
2791 | # Verify re-building and testing works again | 2803 | # Verify re-building and testing works again |
2792 | result = runCmd('%s --build --preset %s --target clean' % | 2804 | result = runCmd('%s --build --preset %s --target clean' % |
2793 | (cmake_exe, preset_name), cwd=tempdir) | 2805 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) |
2794 | self.assertIn("Cleaning", result.output) | 2806 | self.assertIn("Cleaning", result.output) |
2795 | result = runCmd('%s --build --preset %s' % | 2807 | result = runCmd('%s --build --preset %s' % |
2796 | (cmake_exe, preset_name), cwd=tempdir) | 2808 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) |
2797 | self.assertIn("Building", result.output) | 2809 | self.assertIn("Building", result.output) |
2798 | self.assertIn("Linking", result.output) | 2810 | self.assertIn("Linking", result.output) |
2799 | result = runCmd('%s --build --preset %s --target test' % | 2811 | result = runCmd('%s --build --preset %s --target test' % |
2800 | (cmake_exe, preset_name), cwd=tempdir) | 2812 | (cmake_exe, preset_name), cwd=tempdir, output_log=self._cmd_logger) |
2801 | self.assertIn("Running tests...", result.output) | 2813 | self.assertIn("Running tests...", result.output) |
2802 | self.assertIn("100% tests passed", result.output) | 2814 | self.assertIn("100% tests passed", result.output) |
2803 | 2815 | ||
@@ -2822,7 +2834,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2822 | recipe_name, build_file, testimage) | 2834 | recipe_name, build_file, testimage) |
2823 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( | 2835 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( |
2824 | recipe_name, testimage, qemu.ip) | 2836 | recipe_name, testimage, qemu.ip) |
2825 | runCmd(bitbake_sdk_cmd) | 2837 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) |
2826 | self._gdb_cross() | 2838 | self._gdb_cross() |
2827 | self._verify_cmake_preset(tempdir) | 2839 | self._verify_cmake_preset(tempdir) |
2828 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) | 2840 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) |
@@ -2838,7 +2850,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2838 | recipe_name, build_file, testimage) | 2850 | recipe_name, build_file, testimage) |
2839 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( | 2851 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@%s -c --ide=none' % ( |
2840 | recipe_name, testimage, qemu.ip) | 2852 | recipe_name, testimage, qemu.ip) |
2841 | runCmd(bitbake_sdk_cmd) | 2853 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) |
2842 | self._gdb_cross() | 2854 | self._gdb_cross() |
2843 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) | 2855 | self._devtool_ide_sdk_qemu(tempdir, qemu, recipe_name, example_exe) |
2844 | # Verify the oe-scripts sym-link is valid | 2856 | # Verify the oe-scripts sym-link is valid |
@@ -2857,7 +2869,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2857 | recipe_name, build_file, testimage) | 2869 | recipe_name, build_file, testimage) |
2858 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( | 2870 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( |
2859 | recipe_name, testimage) | 2871 | recipe_name, testimage) |
2860 | runCmd(bitbake_sdk_cmd) | 2872 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) |
2861 | self._verify_cmake_preset(tempdir) | 2873 | self._verify_cmake_preset(tempdir) |
2862 | self._verify_install_script_code(tempdir, recipe_name) | 2874 | self._verify_install_script_code(tempdir, recipe_name) |
2863 | self._gdb_cross() | 2875 | self._gdb_cross() |
@@ -2874,7 +2886,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2874 | recipe_name, build_file, testimage) | 2886 | recipe_name, build_file, testimage) |
2875 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( | 2887 | bitbake_sdk_cmd = 'devtool ide-sdk %s %s -t root@192.168.17.17 -c --ide=code' % ( |
2876 | recipe_name, testimage) | 2888 | recipe_name, testimage) |
2877 | runCmd(bitbake_sdk_cmd) | 2889 | runCmd(bitbake_sdk_cmd, output_log=self._cmd_logger) |
2878 | 2890 | ||
2879 | with open(os.path.join(tempdir, '.vscode', 'settings.json')) as settings_j: | 2891 | with open(os.path.join(tempdir, '.vscode', 'settings.json')) as settings_j: |
2880 | settings_d = json.load(settings_j) | 2892 | settings_d = json.load(settings_j) |
@@ -2886,20 +2898,25 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2886 | 2898 | ||
2887 | # Verify meson re-uses the o files compiled by bitbake | 2899 | # Verify meson re-uses the o files compiled by bitbake |
2888 | result = runCmd('%s compile -C %s' % | 2900 | result = runCmd('%s compile -C %s' % |
2889 | (meson_exe, meson_build_folder), cwd=tempdir) | 2901 | (meson_exe, meson_build_folder), cwd=tempdir, |
2902 | output_log=self._cmd_logger) | ||
2890 | self.assertIn("ninja: no work to do.", result.output) | 2903 | self.assertIn("ninja: no work to do.", result.output) |
2891 | 2904 | ||
2892 | # Verify the unit tests work (in Qemu) | 2905 | # Verify the unit tests work (in Qemu) |
2893 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) | 2906 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, |
2907 | output_log=self._cmd_logger) | ||
2894 | 2908 | ||
2895 | # Verify re-building and testing works again | 2909 | # Verify re-building and testing works again |
2896 | result = runCmd('%s compile -C %s --clean' % | 2910 | result = runCmd('%s compile -C %s --clean' % |
2897 | (meson_exe, meson_build_folder), cwd=tempdir) | 2911 | (meson_exe, meson_build_folder), cwd=tempdir, |
2912 | output_log=self._cmd_logger) | ||
2898 | self.assertIn("Cleaning...", result.output) | 2913 | self.assertIn("Cleaning...", result.output) |
2899 | result = runCmd('%s compile -C %s' % | 2914 | result = runCmd('%s compile -C %s' % |
2900 | (meson_exe, meson_build_folder), cwd=tempdir) | 2915 | (meson_exe, meson_build_folder), cwd=tempdir, |
2916 | output_log=self._cmd_logger) | ||
2901 | self.assertIn("Linking target", result.output) | 2917 | self.assertIn("Linking target", result.output) |
2902 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir) | 2918 | runCmd('%s test -C %s' % (meson_exe, meson_build_folder), cwd=tempdir, |
2919 | output_log=self._cmd_logger) | ||
2903 | 2920 | ||
2904 | self._verify_install_script_code(tempdir, recipe_name) | 2921 | self._verify_install_script_code(tempdir, recipe_name) |
2905 | self._gdb_cross() | 2922 | self._gdb_cross() |
@@ -2911,7 +2928,8 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2911 | self._check_workspace() | 2928 | self._check_workspace() |
2912 | 2929 | ||
2913 | result_init = runCmd( | 2930 | result_init = runCmd( |
2914 | 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code') | 2931 | 'devtool ide-sdk -m shared oe-selftest-image cmake-example meson-example --ide=code', |
2932 | output_log=self._cmd_logger) | ||
2915 | bb_vars = get_bb_vars( | 2933 | bb_vars = get_bb_vars( |
2916 | ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support") | 2934 | ['REAL_MULTIMACH_TARGET_SYS', 'DEPLOY_DIR_IMAGE', 'COREBASE'], "meta-ide-support") |
2917 | environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS'] | 2935 | environment_script = 'environment-setup-%s' % bb_vars['REAL_MULTIMACH_TARGET_SYS'] |
@@ -2926,18 +2944,21 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2926 | def runCmdEnv(cmd, cwd): | 2944 | def runCmdEnv(cmd, cwd): |
2927 | cmd = '/bin/sh -c ". %s > /dev/null && %s"' % ( | 2945 | cmd = '/bin/sh -c ". %s > /dev/null && %s"' % ( |
2928 | environment_script_path, cmd) | 2946 | environment_script_path, cmd) |
2929 | return runCmd(cmd, cwd) | 2947 | return runCmd(cmd, cwd, output_log=self._cmd_logger) |
2930 | 2948 | ||
2931 | # Verify building the C++ example works with CMake | 2949 | # Verify building the C++ example works with CMake |
2932 | tempdir_cmake = tempfile.mkdtemp(prefix='devtoolqa') | 2950 | tempdir_cmake = tempfile.mkdtemp(prefix='devtoolqa') |
2933 | self.track_for_cleanup(tempdir_cmake) | 2951 | self.track_for_cleanup(tempdir_cmake) |
2934 | 2952 | ||
2935 | result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake) | 2953 | result_cmake = runCmdEnv("which cmake", cwd=tempdir_cmake, |
2954 | output_log=self._cmd_logger) | ||
2936 | cmake_native = os.path.normpath(result_cmake.output.strip()) | 2955 | cmake_native = os.path.normpath(result_cmake.output.strip()) |
2937 | self.assertExists(cmake_native) | 2956 | self.assertExists(cmake_native) |
2938 | 2957 | ||
2939 | runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake) | 2958 | runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake, |
2940 | runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake) | 2959 | output_log=self._cmd_logger) |
2960 | runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake, | ||
2961 | output_log=self._cmd_logger) | ||
2941 | 2962 | ||
2942 | # Verify the printed note really referres to a cmake executable | 2963 | # Verify the printed note really referres to a cmake executable |
2943 | cmake_native_code = "" | 2964 | cmake_native_code = "" |
@@ -2953,12 +2974,14 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2953 | tempdir_meson = tempfile.mkdtemp(prefix='devtoolqa') | 2974 | tempdir_meson = tempfile.mkdtemp(prefix='devtoolqa') |
2954 | self.track_for_cleanup(tempdir_meson) | 2975 | self.track_for_cleanup(tempdir_meson) |
2955 | 2976 | ||
2956 | result_cmake = runCmdEnv("which meson", cwd=tempdir_meson) | 2977 | result_cmake = runCmdEnv("which meson", cwd=tempdir_meson, |
2978 | output_log=self._cmd_logger) | ||
2957 | meson_native = os.path.normpath(result_cmake.output.strip()) | 2979 | meson_native = os.path.normpath(result_cmake.output.strip()) |
2958 | self.assertExists(meson_native) | 2980 | self.assertExists(meson_native) |
2959 | 2981 | ||
2960 | runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src) | 2982 | runCmdEnv('meson setup %s' % tempdir_meson, cwd=cpp_example_src, |
2961 | runCmdEnv('meson compile', cwd=tempdir_meson) | 2983 | output_log=self._cmd_logger) |
2984 | runCmdEnv('meson compile', cwd=tempdir_meson, output_log=self._cmd_logger) | ||
2962 | 2985 | ||
2963 | def test_devtool_ide_sdk_plugins(self): | 2986 | def test_devtool_ide_sdk_plugins(self): |
2964 | """Test that devtool ide-sdk can use plugins from other layers.""" | 2987 | """Test that devtool ide-sdk can use plugins from other layers.""" |
@@ -2981,7 +3004,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
2981 | return m.group(1).split(',') | 3004 | return m.group(1).split(',') |
2982 | 3005 | ||
2983 | # verify the default plugins are available but the foo plugin is not | 3006 | # verify the default plugins are available but the foo plugin is not |
2984 | result = runCmd('devtool ide-sdk -h') | 3007 | result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) |
2985 | found_ides = get_ides_from_help(result.output) | 3008 | found_ides = get_ides_from_help(result.output) |
2986 | self.assertIn('code', found_ides) | 3009 | self.assertIn('code', found_ides) |
2987 | self.assertIn('none', found_ides) | 3010 | self.assertIn('none', found_ides) |
@@ -3012,7 +3035,7 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
3012 | plugin_file.write(plugin_code) | 3035 | plugin_file.write(plugin_code) |
3013 | 3036 | ||
3014 | # Verify the foo plugin is available as well | 3037 | # Verify the foo plugin is available as well |
3015 | result = runCmd('devtool ide-sdk -h') | 3038 | result = runCmd('devtool ide-sdk -h', output_log=self._cmd_logger) |
3016 | found_ides = get_ides_from_help(result.output) | 3039 | found_ides = get_ides_from_help(result.output) |
3017 | self.assertIn('code', found_ides) | 3040 | self.assertIn('code', found_ides) |
3018 | self.assertIn('none', found_ides) | 3041 | self.assertIn('none', found_ides) |
@@ -3020,14 +3043,16 @@ class DevtoolIdeSdkTests(DevtoolBase): | |||
3020 | 3043 | ||
3021 | # Verify the foo plugin generates a shared config | 3044 | # Verify the foo plugin generates a shared config |
3022 | result = runCmd( | 3045 | result = runCmd( |
3023 | 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name) | 3046 | 'devtool ide-sdk -m shared --skip-bitbake --ide foo %s' % shared_recipe_name, |
3047 | output_log=self._cmd_logger) | ||
3024 | with open(shared_config_file) as shared_config: | 3048 | with open(shared_config_file) as shared_config: |
3025 | shared_config_new = shared_config.read() | 3049 | shared_config_new = shared_config.read() |
3026 | self.assertEqual(shared_config_str, shared_config_new) | 3050 | self.assertEqual(shared_config_str, shared_config_new) |
3027 | 3051 | ||
3028 | # Verify the foo plugin generates a modified config | 3052 | # Verify the foo plugin generates a modified config |
3029 | result = runCmd('devtool ide-sdk --skip-bitbake --ide foo %s %s' % | 3053 | result = runCmd('devtool ide-sdk --skip-bitbake --ide foo %s %s' % |
3030 | (modified_recipe_name, testimage)) | 3054 | (modified_recipe_name, testimage), |
3055 | output_log=self._cmd_logger) | ||
3031 | with open(modified_config_file) as modified_config: | 3056 | with open(modified_config_file) as modified_config: |
3032 | modified_config_new = modified_config.read() | 3057 | modified_config_new = modified_config.read() |
3033 | self.assertEqual(modified_config_str, modified_config_new) | 3058 | self.assertEqual(modified_config_str, modified_config_new) |