UnitTests: Delete output Sys folder before copying to it
Like the previous commit, but for UnitTests. This time all operating systems were affected. I also made UnitTests.vcxproj use the same way of copying as DolphinQt.vcxproj, just for consistency.
This commit is contained in:
parent
a62f8eac1a
commit
f695a65aad
|
@ -9,6 +9,7 @@ set_target_properties(tests PROPERTIES FOLDER Tests)
|
|||
target_link_libraries(tests PRIVATE fmt::fmt gtest::gtest core uicommon)
|
||||
add_test(NAME tests COMMAND tests)
|
||||
add_custom_command(TARGET tests POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
|
||||
)
|
||||
add_dependencies(unittests tests)
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /i /e /s /y /f "$(ProjectDir)\..\..\Data\Sys\" "$(TargetDir)Sys"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Core\DSP\DSPTestBinary.h" />
|
||||
|
@ -109,7 +106,15 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<Target Name="ExecUnitTests" AfterTargets="AfterBuild;CopyDeps" Condition="'$(RunUnitTests)'=='true'">
|
||||
<ItemGroup>
|
||||
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
|
||||
</ItemGroup>
|
||||
<Target Name="AfterBuild" Inputs="@(DataSysFiles)" Outputs="@(DataSysFiles -> '$(TargetDir)%(RecursiveDir)%(Filename)%(Extension)')">
|
||||
<Message Text="Copying Data directory..." Importance="High" />
|
||||
<RemoveDir Directories="$(TargetDir)Sys" />
|
||||
<Copy SourceFiles="@(DataSysFiles)" DestinationFolder="$(TargetDir)%(RecursiveDir)" SkipUnchangedFiles="True" />
|
||||
</Target>
|
||||
<Target Name="ExecUnitTests" AfterTargets="AfterBuild" Condition="'$(RunUnitTests)'=='true'">
|
||||
<!--This is only executed via msbuild, VS test runner automatically does this-->
|
||||
<Exec Command="$(TargetPath)" />
|
||||
</Target>
|
||||
|
|
Loading…
Reference in New Issue