테스트 어댑터 설정
.runettings 파일은 XML 문서로 구성되어 있습니다. 루트 요소인 <RunSettings> 에는 테스트 프레임워크와 관련된 설정이 있습니다. <QtTest> 요소에는 Qt 단위 테스트에 대한 설정이 있습니다.
Visual Studio에서 .runsettings 파일 사용에 대한 자세한 내용은 .runsettings 파일을 사용하여 단위 테스트 구성을 참조하십시오.
필수 요소
<QtTest> 요소에서 Qt 버전을 설정해야 합니다.
| Name | 설명 | 예제 |
|---|---|---|
| QtInstall | 테스트를 빌드하고 실행하는 데 사용되는 Qt 버전을 지정합니다. | <QtInstall>$(DefaultQtVersion)</QtInstall> |
최소 실행 설정 예제
<RunSettings>
<QtTest>
<QtInstall>$(DefaultQtVersion)</QtInstall> <!-- Mandatory -->
</QtTest>
</RunSettings>선택적 요소
다음 표에는 <QtTest> 요소의 선택적 요소가 나열되어 있습니다.
| Name | 설명 | 발생 | 기본값 | 예제 |
|---|---|---|---|---|
| EnabledAdapter | Qt 테스트 어댑터를 활성화 또는 비활성화합니다. | 한번 | true | <EnabledAdapter>true</EnabledAdapter> |
| ShowAdapterOutput | 테스트 어댑터의 출력을 Output > Tests 에 표시합니다. | Once | false | <ShowAdapterOutput>false</ShowAdapterOutput> |
| TestTimeout | 개별 테스트에 대한 시간 제한을 밀리초 단위로 설정합니다. 값이 -1이면 타임아웃이 없습니다. | Once | -1 | <TestTimeout>-1</TestTimeout> |
| DiscoveryTimeout | 테스트 검색에 대한 시간 제한을 밀리초 단위로 설정합니다. 값이 -1이면 시간 초과가 없습니다. | Once | 2000 | <DiscoveryTimeout>2000</DiscoveryTimeout> |
| ParsePdbFiles | PDB 파일을 구문 분석하여 테스트 함수의 소스 파일과 줄 번호를 검색합니다. | 한번 | true | <ParsePdbFiles>true</ParsePdbFiles> |
| 서브시스템 콘솔 전용 | 콘솔 바이너리에서만 Qt 테스트 함수를 검색합니다. | 한번 | true | <SubsystemConsoleOnly>true</SubsystemConsoleOnly> |
출력 섹션
테스트 실행 중에 생성되는 로그의 위치와 형식을 제어합니다.
| 이름 | 설명 | 발생 | 예제 |
|---|---|---|---|
| 파일명 형식 | 테스트 결과를 기록하는 방법과 위치를 정의합니다. 지원되는 출력 형식은 txt, csv, junitxml, xml, lightxml, teamcity 및 tap입니다. | 여러 | <FilenameFormat>PATH,OUTPUTFORMAT</FilenameFormat> |
상세도 섹션
테스트 실행 중에 생성되는 로그의 세부 정보 양에 영향을 줍니다.
| 이름 | 설명 | 발생 빈도 | 기본값 | 예제 |
|---|---|---|---|---|
| Level | 테스트 로그에 보고되는 세부 사항의 양입니다. | 한 번 | 빈 | <Level>silent</Level> 로 설정하면 출력이 최소화됩니다. |
| LogSignals | 모든 방출된 신호와 해당 신호로 인한 슬롯 호출을 기록합니다. | 한번 | false | <LogSignals>false</LogSignals> |
명령 섹션
테스트 실행 방식에 영향을 미치고 테스트 실행 환경을 제어합니다.
| 이름 | 설명 | 발생 | 기본값 | 예제 |
|---|---|---|---|---|
| EventDelay | 이벤트 시뮬레이션의 지연을 제어합니다. | Once | -1 | <EventDelay>-1</EventDelay> |
| KeyDelay | 이벤트 시뮬레이션의 지연을 제어합니다. | 한 번 | -1 | <KeyDelay>-1</KeyDelay> |
| MouseDelay | 이벤트 시뮬레이션의 지연을 제어합니다. | 한번 | -1 | <MouseDelay>-1</MouseDelay> |
| MaxWarnings | 출력할 최대 경고 수입니다. | 한번 | 2000 | <MaxWarnings>2000</MaxWarnings> |
| NoCrashHandler | Windows 오류 보고 대화 상자를 활성화 또는 비활성화합니다. | 한 번 | false | <NoCrashHandler>false</NoCrashHandler> |
.runsettings 파일 예제
다음 XML은 기본 Qt .runettings 파일의 내용을 보여줍니다. <QtInstall> 은 필수이고, 다른 모든 요소나 섹션은 Qt 테스트 어댑터가 기본값을 제공하기 때문에 선택 사항입니다.
<?xml version="1.0" encoding="utf-8"?>
<!-- File name extension must be .runsettings -->
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022 -->
<RunSettings>
<QtTest>
<!-- "The Qt version used to build and run the tests. -->
<QtInstall>$(DefaultQtVersion)</QtInstall> <!-- Mandatory. -->
<!-- Enables or disables showing all output generated by the test adapter into the default
'Output | Tests' pane. The default value is false. -->
<ShowAdapterOutput>false</ShowAdapterOutput> <!-- Optional. -->
<!-- Terminates a running test if it exceeds the specified timeout in milliseconds.
A timeout of -1 means the test will not be terminated. The default value is -1. -->
<TestTimeout>-1</TestTimeout> <!-- Optional. -->
<!-- Terminates a running discovery if it exceeds the specified timeout in milliseconds.
A timeout of -1 means the test will not be terminated. The default value is 2000. -->
<DiscoveryTimeout>2000</DiscoveryTimeout> <!-- Optional. -->
<!-- Enables or disable parsing of PDB files to retrieve the source file and line number
of test functions for an executable. The default value is true. -->
<ParsePdbFiles>true</ParsePdbFiles> <!-- Optional. -->
<!-- Scan only console binaries (/SUBSYSTEM:CONSOLE) for Qt test functions. Set to false to
scan all binary types at the cost of longer discovery time. The default value is true. -->
<SubsystemConsoleOnly>true</SubsystemConsoleOnly> <!-- Optional. -->
<!-- Allows multiple FilenameFormat tags for specifying different output files and formats. -->
<Output> <!-- This section is optional. -->
<!--
Writes the test output to the specified file using the specified output format.
Supported output formats: txt, csv, junitxml, xml, lightxml, teamcity, tap. Needs
to follow this convention:
<FilenameFormat>PATH,OUTPUTFORMAT</FilenameFormat>
-->
</Output>
<!-- Control how much detail is reported in test logs. -->
<Verbosity> <!-- This section is optional. -->
<!--
Supported values: silent, v1, v2
silent: only shows fatal errors, test failures and minimal status messages.
v1: shows when each test function is entered. Only affects plain text output.
v2: Extended verbose output; shows each QCOMPARE() and QVERIFY(). This option
affects all output formats and implies -v1 for plain text output.
"The default value is empty."
-->
<Level></Level> <!-- Optional. -->
<!-- Enables or disables logging all signals that get emitted and the slot invocations
resulting from those signals. The default value is disabled. -->
<LogSignals>false</LogSignals> <!-- Optional. -->
</Verbosity>
<!-- The following command-line options influence how tests are run. -->
<Commands> <!-- This section is optional. -->
<!-- If no delay is specified for keyboard or mouse simulation
(QTest::keyClick(), QTest::mouseClick() etc.), the value from this parameter
(in milliseconds) is substituted. The default value is -1. -->
<EventDelay>-1</EventDelay> <!-- Optional. -->
<!-- Like 'EventDelay', but only influences keyboard simulation and not mouse
simulation. The default value is -1.-->
<KeyDelay>-1</KeyDelay> <!-- Optional. -->
<!-- Like 'EventDelay', but only influences mouse simulation and not keyboard
simulation. The default value is -1. -->
<MouseDelay>-1</MouseDelay> <!-- Optional. -->
<!-- Sets the maximum number of warnings to output. 0 for unlimited, defaults to 2000. -->
<MaxWarnings>2000</MaxWarnings> <!-- Optional. -->
<!-- Enables or disables the Windows Error Reporting dialog, which is disabled by
default. The default value is false. -->
<NoCrashHandler>false</NoCrashHandler> <!-- Optional. -->
</Commands>
</QtTest>
</RunSettings>튜토리얼: Qt Test 애플리케이션, .runsettings 파일을 사용하여 Qt 테스트 구성하기 및 파일을참조하십시오 .
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.