Merge remote-tracking branch 'origin/topic/timw/windows-ci-unit-testing'

* origin/topic/timw/windows-ci-unit-testing:
  Modify Windows test cmd file to actually run tests
  Add template file and cmake call for zeek-path setup on Windows
This commit is contained in:
Tim Wojtulewicz 2023-04-27 11:25:45 -07:00
commit f3f139deab
6 changed files with 28 additions and 5 deletions

View file

@ -1,3 +1,9 @@
6.0.0-dev.457 | 2023-04-27 11:25:45 -0700
* Modify Windows test cmd file to actually run tests (Tim Wojtulewicz)
* Add template file and cmake call for zeek-path setup on Windows (Tim Wojtulewicz)
6.0.0-dev.453 | 2023-04-27 13:22:43 +0200
* Revert putting plugins into a fresh scope for now (Dominik Charousset, Corelight)

View file

@ -423,6 +423,10 @@ set(cmake_install_prefix "${CMAKE_INSTALL_PREFIX}")
set(cmake_source_dir "${CMAKE_SOURCE_DIR}")
set(zeek_script_install_path "${ZEEK_SCRIPT_INSTALL_PATH}")
if ( MSVC )
# This has to happen before we modify the paths below so that
# the pure Windows paths are stored in the output file.
configure_file(zeek-path-dev.bat.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev.bat)
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_binary_dir "${cmake_binary_dir}")
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_current_binary_dir "${cmake_current_binary_dir}")
string(REGEX REPLACE "^([A-Za-z]):/(.*)" "/\\1/\\2" cmake_install_prefix "${cmake_install_prefix}")

View file

@ -1 +1 @@
6.0.0-dev.453
6.0.0-dev.457

View file

@ -1,7 +1,11 @@
:: See build.cmd for documentation on this call.
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
:: We currently don't have any tests to run on Windows, so this is just commented out.
:: We'll expand on this later.
:: cd build
:: ctest -C release || exit \b 1
cd build
:: This sets up ZEEKPATH and ZEEK_PLUGIN_PATH
call zeek-path-dev.bat
:: Only run the unit tests for now. Btest is supported on Windows but a ton
:: of tests are still failing so it's not worth trying to run it.
src\zeek --test

8
zeek-path-dev.bat.in Normal file
View file

@ -0,0 +1,8 @@
:: Sets up the basic environment needed to run Zeek from a Windows command prompt (not bash!).
:: This is needed in order to run unit tests on Cirrus.
::
:: The ZEEKPATH line here should be kept in sync with the zeek-path-dev.in file.
::
@set ZEEKPATH=.;${cmake_source_dir}/scripts;${cmake_source_dir}/scripts/policy;${cmake_source_dir}/scripts/site;${cmake_binary_dir}/scripts;${cmake_binary_dir}/scripts/builtin-plugins
@set ZEEK_PLUGIN_PATH=${cmake_binary_dir}/src}

View file

@ -9,5 +9,6 @@
#
# ZEEKPATH=`./zeek-path-dev` ./src/zeek
#
# This file should be kept in sync with the ZEEKPATH line in zeek-path-dev.bat.in.
echo .:${cmake_source_dir}/scripts:${cmake_source_dir}/scripts/policy:${cmake_source_dir}/scripts/site:${cmake_binary_dir}/scripts:${cmake_binary_dir}/scripts/builtin-plugins