Unit testing NI实验室Windows CVI有哪些测试框架可用?

Unit testing NI实验室Windows CVI有哪些测试框架可用?,unit-testing,cvi,Unit Testing,Cvi,我被迫使用NI实验室Windows CVI,我喜欢使用TDD。但是,我找不到该IDE的任何测试框架。有什么已知的解决方案吗?我刚和NI的某个人谈过 NI实验室视图有一些单元测试框架,这是完全不同的 目前没有来自镍的溶液。在过去,有些人用另一种方法解决他们的问题 编辑: 将CUNIT与CVI结合使用非常简单-尽管您仍然面临一些语言障碍: #include "CUError.h" #include "CUError.c" #include "CUnit.h" #include "MyMem.h" #

我被迫使用NI实验室Windows CVI,我喜欢使用TDD。但是,我找不到该IDE的任何测试框架。有什么已知的解决方案吗?

我刚和NI的某个人谈过

NI实验室视图有一些单元测试框架,这是完全不同的

目前没有来自镍的溶液。在过去,有些人用另一种方法解决他们的问题

编辑:

将CUNIT与CVI结合使用非常简单-尽管您仍然面临一些语言障碍:

#include "CUError.h"
#include "CUError.c"
#include "CUnit.h"
#include "MyMem.h"
#include "MyMem.c"
#include "TestDB.h"
#include "TestDB.c"
#include "TestRun.h"
#include "TestRun.c"
#include "Util.h"
#include "Util.c"
#include "Automated.h"
#include "Automated.c"
使用SEE include语句应允许您运行以下代码:

static void testFail(void)
{
        CU_ASSERT(0);
}

//Suite Definitions
static CU_TestInfo tests_GenList[] = {
  { "Should Fail", testFail },
    CU_TEST_INFO_NULL,
};

static CU_SuiteInfo suites[] = {
  { "Generic List Suites",  NULL, NULL, tests_GenList },
    CU_SUITE_INFO_NULL,
};

void AddTests(void)
{
  assert(NULL != CU_get_registry());
  assert(!CU_is_test_running());

    /* Register suites. */
    if (CU_register_suites(suites) != CUE_SUCCESS) {
        fprintf(stderr, "suite registration failed - %s\n",
            CU_get_error_msg());
        exit(EXIT_FAILURE);
    }
}

int main (void)
{
    CU_initialize_registry();
    AddTests();
    CU_set_output_filename("Result\\TestAutomated");
    CU_list_tests_to_file();
    CU_automated_run_tests();
    CU_cleanup_registry();
    return 0;
}
还要将这些文件复制到结果目录中:

CUnit-List.dtd
CUnit-List.xsl
CUnit-Run.dtd
CUnit-Run.xsl
md2xml.pl
Memory-Dump.dtd
Memory-Dump.xsl

我们也在这里使用CUnit和CMock()。使用cvi,您甚至可以自动化ruby脚本来执行test_runner builder之类的工具

"%RUBY_HOME%\bin\ruby.exe" "%UNITY_HOME%\auto\generate_test_runner.rb"  
Test\u TestCycleFSM.c 在预构建步骤中。您可能需要编译项目两次才能生成源文件,然后再编译它


毕竟,CUnit似乎是C中的测试套件。

我对CUnit有问题,但实际上您可以使用GTest并导入带有外部“C”包装的C头。你需要的是一个编译器,既可以同时做C和C++。最后,我把CVI扔掉并使用VS2010解决了这个问题。@Johannes:我已经(字面上)请求过了。但我一定会选择CVI,这是“没有干净的构建”选项。我听到了。我仍然无法说服所有人。我的公司为CVI支付了大笔费用,甚至没有使用它的“功能”。也许我们应该转到程序员部分,开始一篇关于CVI中哪些不好的文章。:)