This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created a template for testing. Create a new test. Template in the editor does not get. Создал шаблон для тестов. Создаю новый тест. Шаблон в редактор не попадает.
I'm unable to repoduce it with the current dev build: - added new template for c tests - created a new file from this template Code from the file appears in the editor. Please specify NB build you're using and the exact steps to reproduce.
Версия NB 7.3 версии 7.4 еще нет. Открываю NB Сервис Шаблоны С Простой тест С С помощью комментариев /* */ Закомментировал test2 и его вызов Получился шаблон: /* * File: %<%NAME%>%.%<%EXTENSION%>% * Author: %<%USER%>% * * Created on %<%DATE%>%, %<%TIME%>% */ #include <stdio.h> #include <stdlib.h> /* * Simple C Test Suite */ void test1() { printf("%<%NAME%>% test 1\n"); } /* void test2() { printf("%<%NAME%>% test 2\n"); printf("%%TEST_FAILED%% time=0 testname=test2 (%<%NAME%>%) message=error message sample\n"); } */ int main(int argc, char** argv) { printf("%%SUITE_STARTING%% %<%NAME%>%\n"); printf("%%SUITE_STARTED%%\n"); printf("%%TEST_STARTED%% test1 (%<%NAME%>%)\n"); test1(); printf("%%TEST_FINISHED%% time=0 test1 (%<%NAME%>%) \n"); /* printf("%%TEST_STARTED%% test2 (%<%NAME%>%)\n"); test2(); printf("%%TEST_FINISHED%% time=0 test2 (%<%NAME%>%) \n"); */ printf("%%SUITE_FINISHED%% time=0\n"); return (EXIT_SUCCESS); } Захожу в свой проект. Файлы тестов. Контекстным меню выбираю Новый тест Простой тест С В диалоге задаю имя теста и имя программы Получаю следующее: /* * File: tstTrMtoV.c * Author: misha * * Created on 16.05.2013, 9:06:41 */ #include <stdio.h> #include <stdlib.h> /* * Simple C Test Suite */ void test1() { printf("tstTrMtoV test 1\n"); } void test2() { printf("tstTrMtoV test 2\n"); printf("%%TEST_FAILED%% time=0 testname=test2 (tstTrMtoV) message=error message sample\n"); } int main(int argc, char** argv) { printf("%%SUITE_STARTING%% tstTrMtoV\n"); printf("%%SUITE_STARTED%%\n"); printf("%%TEST_STARTED%% test1 (tstTrMtoV)\n"); test1(); printf("%%TEST_FINISHED%% time=0 test1 (tstTrMtoV) \n"); printf("%%TEST_STARTED%% test2 (tstTrMtoV)\n"); test2(); printf("%%TEST_FINISHED%% time=0 test2 (tstTrMtoV) \n"); printf("%%SUITE_FINISHED%% time=0\n"); return (EXIT_SUCCESS); } Полученный результат не соответствует заданному шаблону.
will have a look, thanks!
You need to change templates/c/c++ tests/simpletestfile.c not templates/c/c simple test. However in tests category all templates are duplicated, I'll fix that.
duplicated templates in tests category fixed in: http://hg.netbeans.org/cnd-main/rev/80091b837537
Integrated into 'main-golden', will be available in build *201305170640* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/80091b837537 User: Egor Ushakov <gorrus@netbeans.org> Log: fixed #227685 - Test pattern