From f36d6e350eb22ab987abdde39c1b30b551eedf6b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 May 2016 09:55:05 -0400 Subject: [PATCH 1/2] Add test configuration for Appveyor. --- .appveyor.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..64e7ae64 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,40 @@ +# Windows Build Configuration for AppVeyor +# http://www.appveyor.com/docs/appveyor-yml + +# build version format +version: "{build}" + +os: Visual Studio 2013 + +platform: + - Any CPU + +configuration: + - Debug + - Release + +branches: + only: + - master + +clone_depth: 5 + +matrix: + fast_finish: true # Show final status immediately if a test fails. + +# scripts that run after cloning repository +install: + - git clone https://github.com/google/googletest.git External/googletest + +build: + parallel: true # enable MSBuild parallel builds + verbosity: minimal + +build_script: + - mkdir build && cd build + - cmake .. -DCMAKE_INSTALL_PREFIX=install + - cmake --build . --config %CONFIGURATION% --target install + +test_script: + - ctest -C %CONFIGURATION% --output-on-failure + - cd ../Test && bash runtests From cb3236d9f9948985e1413aa42ed266f6fc279a08 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 May 2016 10:22:48 -0400 Subject: [PATCH 2/2] Use std::string for TBD/missing functionality reporting. We can have multiple instances of the same string, so comparing const char* is not guaranteed working. Fixed the failure on VS 2013 with Debug build. --- SPIRV/Logger.cpp | 4 ++-- SPIRV/Logger.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SPIRV/Logger.cpp b/SPIRV/Logger.cpp index 2977ea39..7edf4265 100644 --- a/SPIRV/Logger.cpp +++ b/SPIRV/Logger.cpp @@ -40,13 +40,13 @@ namespace spv { -void SpvBuildLogger::tbdFunctionality(const char* f) +void SpvBuildLogger::tbdFunctionality(const std::string& f) { if (std::find(std::begin(tbdFeatures), std::end(tbdFeatures), f) == std::end(tbdFeatures)) tbdFeatures.push_back(f); } -void SpvBuildLogger::missingFunctionality(const char* f) +void SpvBuildLogger::missingFunctionality(const std::string& f) { if (std::find(std::begin(missingFeatures), std::end(missingFeatures), f) == std::end(missingFeatures)) missingFeatures.push_back(f); diff --git a/SPIRV/Logger.h b/SPIRV/Logger.h index 2b9eb0d5..15b5e354 100644 --- a/SPIRV/Logger.h +++ b/SPIRV/Logger.h @@ -48,9 +48,9 @@ public: SpvBuildLogger(const SpvBuildLogger&) = delete; // Registers a TBD functionality. - void tbdFunctionality(const char* f); + void tbdFunctionality(const std::string& f); // Registers a missing functionality. - void missingFunctionality(const char* f); + void missingFunctionality(const std::string& f); // Logs a warning. void warning(const std::string& w) { warnings.push_back(w); } @@ -62,8 +62,8 @@ public: std::string getAllMessages() const; private: - std::vector tbdFeatures; - std::vector missingFeatures; + std::vector tbdFeatures; + std::vector missingFeatures; std::vector warnings; std::vector errors; };