如何单元测试WIX合并模块? [英] How to unit test WIX merge modules?

查看:336
本文介绍了如何单元测试WIX合并模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WIX构建合并模块。调用WIX工具从* .wxs文件生成合并模块的批处理文件由我的日常生成运行。

I am building merge modules with WIX. The batch files which calls the WIX tools to generate the merge modules from *.wxs files are run by my daily build.

我试图找出如何自动化这些合并模块的测试。我想测试的是,合并模块是否安装所需的文件,文件的版本是否正确等。

I am trying to figure out how could I automate the testing of these merge modules. Things I would like to test are, whether the merge module installs required files, whether the versions of the files are correct etc.

我有一个想法是写一个脚本(可能是VB Script)将合并模块安装在临时位置,并检查其是否已正确安装。但是,我不知道这是否是一个正确的方法。

One idea I have is to write a script (may be VB Script) to install the merge module at a temporary location and check if it has installed everything correctly. However, I am not sure if this is a correct way to do it.

有没有任何标准的方法编写合并模块的单元测试?

Are there any standard ways of writing unit tests for merge modules? Any ideas around how to go about this are welcome.

推荐答案

我经常想到这一点,但没有想出任何我喜欢的。首先我称这种集成测试不是严格的单元测试。第二,正确的文件和正确的版本的问题很难定义。

I've often thought about this but haven't come up with anything that I like. First I would call this integration testing not strictly unit testing. Second the problem of "right files" and "right versions" is difficult to define.

我经常被诱惑说WiX / MSI只是定义安装程序要做什么的数据。它是声明性的,因此根据定义是正确的。很容易想创建另一组数据来交叉检查安装程序的实现,但是第一个数据集没有表示什么呢?有时候,为了维护第二个文件列表,有时需要维护应用程序中的文件。

I'm often tempted to say WiX/MSI is just data that defines what the installer is to do. It's declarative in nature and therefore by definition correct. It's tempting to want to create yet another set of data that cross checks the implementation of the installer but what exactly does that accomplish that the first data set didn't already represent? It's hard enough sometimes to maintain what files go into an application yet alone to maintain a second list of files.

我继续思考这个问题,想知道是否有一种方法将有意义,但在这一点上,我只是做我的正常MSI验证。

I continue to think about this and wonder if there's an approach that would make sense but at this point I just do my normal MSI validation.

这篇关于如何单元测试WIX合并模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆