如何为jsUnit-ant-script指定相对路径?
JsUnit 提供了一个目标为“standalone_test”的 ant 脚本。 该目标使用属性 url 来标识执行测试的 HTML 站点。 这些站点已签入,因此每个人都应该能够在签出后执行此测试。 这是可行的,但 url-proprty 必须设置为绝对路径,例如 file:///home/user/projects/my-project/path/in/project/jsunit/testRunner.html 。 这可以避免自动启动,每个人也可以使用在他的盒子上构建的路径来指定命令。 是否可以传递相对路径/url,以便自动执行这些测试? 这将有助于在我们的持续集成系统中设置这些测试。
JsUnit provides an ant-script with the target 'standalone_test'. This target uses the property url to identify the HTML-site, that executes the tests. These site is checked in, so that everyone should be able after a checkout to execute this tests. This works, but the url-proprty must be set to an absolute path, like file:///home/user/projects/my-project/path/in/project/jsunit/testRunner.html
. That avoids an automatic start, everyone have too specify a command with the path constructed on his box. Is it possible to pass a relative path/url instead, so that the execution of these tests can be automated? This would be helpful to setup these test in our continuous-integration-system.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 构造
url
属性值内置 Antbasedir
属性。例如,如果您的构建脚本位于
/home/user/projects/my-projects
目录中并从中运行,您可以将url
属性设置为:You could construct the
url
property value using the built-in Antbasedir
property.For example, if your build script is located in and run from your
/home/user/projects/my-projects
directory you could set yoururl
property as: