From 90d6a401ee0d6327b068e58a64a10f620300a38e Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 14 Jun 2017 09:10:22 -0700 Subject: AppVeyor: Run tests as part of AppVeyor builds This includes a bunch of related changes: - `slang-test` - Add a notion of an "output mode" that specifies whether we output to console (the default), or invoke the apprpriate AppVeyor command to update test status - Add a notion of test categories, so that tests can be tagged with categories, and then we can invoke only those tets in a given category, or choose to *exclude* tests with specific categories - Allow the `OSProcessSpawner` to look up an executable by "path" (meaning a full path is expected) or by "name" (meaning it should be allowed to look in the current directory, `PATH` environment variable, etc.). This was important to make sure that I can run `appveyor` without having to know its absolute path. - AppVeyor configuration - Change badge to reflect new build account for organization (rather than a single-user account) - Remove attempt to set AppVeyor build version in a clever way, since it breaks links from GitHub to AppVeyor - Change order or configurations in the build matrix to front-load the Release build (which has the main tests) - Turn on `fast_finish` flag so we don't have to wait as long for failed builds - Turn on `parallel` builds - Set `verbosity: minimal` to avoid getting build spew about Xamarin stuff I'm not using - Add custom `test_script` to invoke `test.bat` - Sets the test category based on teh build configuration, so we don't run the full test suite on every input. - `test.bat` - Allow for `-platform` and `-configuration` arguments - Rewrute a platform of `Win32` over to `x86` to match how the output directories are named - Futz around with how the directories are being passed along to work around annoying `.bat` file quoting behavior (I still don't get how batch files work) - Tests - Mark a bunch of tests as `smoke` tests - Mark the relevant tests as `render` tests (these get filtered out for AppVeyor builds) --- test.bat | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'test.bat') diff --git a/test.bat b/test.bat index b4398b991..38378a2e3 100644 --- a/test.bat +++ b/test.bat @@ -16,19 +16,40 @@ if "%1"=="-release" ( shift goto :ARGLOOP ) +if "%1"=="-platform" ( + set SLANG_TEST_PLATFORM=%2 + shift + shift + goto :ARGLOOP +) +if "%1"=="-configuration" ( + set SLANG_TEST_CONFIG=%2 + shift + shift + goto :ARGLOOP +) :: When done with arguments, we'll just fall through here +:: Set root directory to the directory where `test.bat` resides +:: (which should be the root of the source tree) SET "SLANG_TEST_ROOT=%~dp0" +:: If platform and configuration haven't been set, then set +:: them to default values. IF "%SLANG_TEST_PLATFORM%" == "" ( SET "SLANG_TEST_PLATFORM=x86" ) IF "%SLANG_TEST_CONFIG%" == "" ( SET "SLANG_TEST_CONFIG=Debug" ) -set "SLANG_TEST_BIN_DIR=%SLANG_TEST_ROOT%bin\%SLANG_TEST_PLATFORM%\%SLANG_TEST_CONFIG%\\" +:: If the user specified a platform of "Win32" swap that to "x86" +:: to match how we are generating our output directories. +IF "%SLANG_TEST_PLATFORM%"=="Win32" ( Set "SLANG_TEST_PLATFORM=x86" ) + +:: Establish the directory where the binaries to be tested reside +set "SLANG_TEST_BIN_DIR=%SLANG_TEST_ROOT%bin\%SLANG_TEST_PLATFORM%\%SLANG_TEST_CONFIG%\" :: ensure that any built tools are visible SET "PATH=%PATH%;%SLANG_TEST_BIN_DIR%" -:: TODO: ensure that everything is built? +:: TODO: Maybe we should actually invoke `msbuild` to make sure all the code is up to date? -"%SSLANG_TEST_BIN_DIR%slang-test.exe" --bindir "%SLANG_TEST_BIN_DIR%" %* +"%SLANG_TEST_BIN_DIR%slang-test.exe" -bindir "%SLANG_TEST_BIN_DIR%\" %* -- cgit v1.2.3