반응형

Visual Studio에서 google test를 돌리고 있는데

분명 활성화돤 Test Fixture들이 있음에도 아래처럼 테스트 탐색기에서 테스트 코드를 인식하지 못하는 상황이 발생했다.

테스트 출력 코드를 보니 오류 내용이 있다.

 

Visual Studio 2015 의 테스트 탐색기 창

 

아래는 테스트 출력

------ 테스트 검색 시작 ------
테스트 실행에서는 프레임워크 Framework45 및 플랫폼 X86용으로 작성된 DLL을 사용합니다. 다음 DLL은 실행에서 사용할 수 없습니다. 
..., gtest.exe은(는) 프레임워크 None 및 플랫폼 X64용으로 작성되었습니다.
. 이러한 설정을 관리하는 방법에 대해 자세히 알아보려면 http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409을(를) 참조하십시오.
[20:34:09.483] Google Test Adapter: Test discovery starting...
[20:34:09.624 ERROR] Could not list test cases of executable 'gtest.exe': executing process failed with return code -1073741515
Command executed: 'gtest.exe --gtest_list_tests', working directory: ''
Command produced no output
[20:34:09.625] Found 0 tests in executable gtest.exe
[20:34:09.625] Test discovery completed, overall duration: 00:00:00.1412631
[20:34:09.625 ERROR] 
================
The following warnings and errors occured during test discovery (enable debug mode for more information):
[20:34:09.624 ERROR] Could not list test cases of executable 'gtest.exe': executing process failed with return code -1073741515
Command executed: 'gtest.exe --gtest_list_tests', working directory: ''
Command produced no output
========== 테스트 검색 완료: 0개 찾음(0:00:00.2912214) ==========

 

gtest 프로젝트를 실행시키니 실행되지 않는다.

DLL 문제였다. 

 

테스트 출력을 보니 gtest의 테스트들을 visual studio가 어떻게 인식하는지 알겠다.

gtest.exe가 우선 정상 동작해야한다. 약속된 인자를 통해 테스트 함수들의 정보를 받는것 같다.

 

참고로 최근에 추가한 fixture가 런타임에 특정 DLL을 로딩하려고 했지만

gtest의 working directory에 없어서 오류가 발생했다.

DLL의 invalid architeture 문제도 있었는데 그건 전처리기에 문제였고 모두 잘 해결했다.

( 최근에 추가한 오픈소스가 cmake로 자동 생성한 전처리기인데 x64 모듈임에도 WIN32가 붙어 있어서 문제였다..)

 

테스트 출력 오류 로그를 통해 덤으로 gtest 인자도 알게 되었다(?). 찾던 기능이였는데 gtest.exe 인자를 통해 원하는 fixture를 실행할 수 있는것 같다.

반응형

+ Recent posts