From 7a8e2ec8167fefba341bd60522157961bcf9236b Mon Sep 17 00:00:00 2001 From: wangqr Date: Sat, 14 Sep 2019 21:11:03 -0400 Subject: [PATCH] Fix gtest setup.bat on Windows --- CMakeLists.test.txt | 2 +- tests/setup.bat | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CMakeLists.test.txt b/CMakeLists.test.txt index f24fa80e7..252a72a27 100644 --- a/CMakeLists.test.txt +++ b/CMakeLists.test.txt @@ -51,7 +51,7 @@ if(GTEST_FOUND) tests/support/util.cpp ) target_compile_definitions(gtest-run PRIVATE CMAKE_BUILD) - target_include_directories(gtest-run PRIVATE tests/support ${GTEST_INCLUDE_DIRS}) + target_include_directories(gtest-run PRIVATE tests/support ${Boost_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}) target_link_libraries(gtest-run libaegisub ${Boost_LIBRARIES} ${ICU_LIBRARIES} ${GTEST_LIBRARIES}) if(MSVC) set_target_properties(gtest-run PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h") diff --git a/tests/setup.bat b/tests/setup.bat index d2a6ec564..e66aa27a4 100644 --- a/tests/setup.bat +++ b/tests/setup.bat @@ -4,13 +4,13 @@ icacls data /grant:r %USERNAME%:F /T rd /s /q data mkdir data -echo '' > data/file +copy nul data\file mkdir data\dir -echo > data/file_access_denied +copy nul data\file_access_denied icacls data\file_access_denied /deny %USERNAME%:F -echo > data/file_read_only +copy nul data\file_read_only icacls data\file_read_only /deny %USERNAME%:W @@ -24,17 +24,14 @@ echo {"Video" : ["Entry One", "Entry Two"]} > data/mru_ok.json echo {"Video" : [1, 3]} > data/mru_invalid.json -echo '1234567890' > data\ten_bytes -echo '' > data\touch_mod_time - -mkdir data/options -cp options/* data/options +< nul set /p ="1234567890" > data\ten_bytes +copy nul data\touch_mod_time mkdir data\dir_iterator -echo '' > data\dir_iterator\1.a -echo '' > data\dir_iterator\2.a -echo '' > data\dir_iterator\1.b -echo '' > data\dir_iterator\2.b +copy nul data\dir_iterator\1.a +copy nul data\dir_iterator\2.a +copy nul data\dir_iterator\1.b +copy nul data\dir_iterator\2.b mkdir data\options xcopy "%~dp0\options" data\options @@ -47,3 +44,5 @@ xcopy "%~dp0\vfr" data\vfr\in mkdir data\keyframe xcopy "%~dp0\keyframe" data\keyframe + +ping -n 2 127.0.0.1 > nul