我正在使用 Boost.test 库为应用程序开发单元测试用例。有一些API可以直接测试。
但是,有些 API 需要测试机器之间的交互。例如,在机器 1 中执行某个 API 应该会触发测试机器 2 中的 API,并且需要在机器 1 中再次使用其响应才能成功完成。
我怎样才能同步这个? Boost 是否为这种交互提供其他库?如果还有其他方法,请提出建议。
预先感谢您的时间和帮助。
I am developing unit test cases for an application using Boost.test libraries. There are certain APIs which can directly be tested.
But, there are APIs which require interaction between test machines. So for example, execution of a certain API in machine 1 should trigger an API in test machine 2 and its response needs to be used again in machine 1 for successful completion.
How can I synchronize this ? Does Boost provide other libraries for this interaction? If there are any other approaches, kindly suggest them.
Thanks in advance for your time and help.
发布评论
评论(1)
您可以为此交互编写两种测试:
在这两种测试中,您可能需要使用事件和 WaitForSingleObject 以确保测试不会在响应返回之前结束。
There are two kinds of tests you can write for this interaction:
In both kinds of tests you might be required to use events and WaitForSingleObject to make sure that the test won't end before the response has returned.