简体   繁体   English

如何配置eclipse(pydev)以与外部可执行文件一起运行

[英]how to configure eclipse(pydev) to run with external executable

I have a test framework where all my tests have to be kicked off using a particular executable(say M). 我有一个测试框架,必须使用特定的可执行文件(例如M)启动所有测试。 All my tests are written in python(I have eclipse configured with pydev) . 我所有的测试都是用python编写的(我已经用pydev配置了eclipse)。 Currently I run my tests are run thru cmdline like: $ M -test <test_file_name>.<testcase_name> How do I configure eclipse run configuration so I can actually do run /debug from eclipse? 目前,我通过cmdline运行测试,例如: $ M -test <test_file_name>.<testcase_name>如何配置Eclipse运行配置,以便实际上可以从Eclipse运行/ debug? I am not able able to find any documentation that tells me if I can use the "Program Arguments" in the run/debug configuration to set this up? 我找不到能告诉我是否可以在运行/调试配置中使用“程序自变量”进行设置的文档?

PyDev always will run with the python executable you configure in the interpreter preferences (so, if you want to run with a different executable, it'll only work if it's a program that is configured in the interpreter preferences and that can launch any python script -- as does the regular interpreter). PyDev始终将与您在解释器首选项中配置的python可执行文件一起运行(因此,如果要与其他可执行文件一起运行,则只有在该程序在解释器首选项中配置并且可以启动任何python脚本的程序才能运行-和常规口译员一样)。

If that's not your case, what you can do is configure an external tool to make the run (run > external tools > external tools configurations > program) and then use it to run. 如果不是您这种情况,您可以配置一个外部工具进行运行(运行>外部工具>外部工具配置>程序),然后使用它来运行。

Now, if your executable does work as a python executable (or if you're running with Python itself) see: 现在,如果您的可执行文件确实可以作为python可执行文件工作(或者您正在使用Python本身运行),请参见:

Getting started on how to run a program: http://pydev.org/manual_101_run.html 如何运行程序入门: http : //pydev.org/manual_101_run.html

How to run a unittest: http://pydev.org/manual_adv_pyunit.html 如何运行单元测试: http : //pydev.org/manual_adv_pyunit.html

You have to configure PyDev and give him a path to the executable/interpreter 您必须配置PyDev并为他提供可执行文件/解释器的路径

From this site : 从此站点

  1. Go to: window > preferences > PyDev > Interpreter - (Python/Jython/IronPython). 转到:窗口>首选项> PyDev>解释器-(Python / Jython / IronPython)。

  2. Choose the interpreter you have installed in your computer (such as python.exe, jython.jar or ipy.exe). 选择您已安装在计算机中的解释器(例如python.exe,jython.jar或ipy.exe)。

Other source for possible problems/solutions 可能出现问题/解决方案的其他来源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM