背景
我正在 Node.js 中开发一个程序,并使用 Chai 和 SinonJS 在 Mocha 中编写我的测试套件。我有控制对node-webgl上下文的访问的核心图形模块。
由于node-webgl工作原理,我只想为整个测试运行初始化一次上下文。我希望在核心模块初始化之前运行一些测试,如下所示:
describe('module:core', function () {
describe('pre-init', function () {
describe('.isInitialized', function () {
it('should return false if the module is not initialized', function () {
expect(core.isInitialized()).to.be.false;
});
});
describe('.getContext', function () {
it('should error if no context is available', function () {
expect(function () {
core.getContext();
}).to.throw(/no context/i);
});
});
});
describe('.init', function () {
it('should error on an invalid canvas', function () {
expect(function () …Run Code Online (Sandbox Code Playgroud) 在尝试用 C++ 构建个人项目时,我遇到了一个问题。我不确定它何时出现,因为我通常在 Linux 环境中处理该项目,但希望该项目在 Windows 上运行。
不幸的是,我正在使用的编译器 Clang 已经开始向我抛出以下错误:
libboost_filesystem-vc140-mt-1_61.lib(operations.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in buffer.obj
Run Code Online (Sandbox Code Playgroud)
问题是我不知道如何告诉 Clang 底层编译器应该使用哪个运行时,clang-cl如果我不需要,我现在不希望使用。
使 Windows 上的 Clang 链接到动态运行时的正确方法是什么?
c++ ×1
clang ×1
clang++ ×1
javascript ×1
mocha.js ×1
node.js ×1
runtime ×1
unit-testing ×1
windows ×1