Browse Source

For CI - avoid hard-coding of the sample list in the build script.
Switch the build output verboseness to normal as the diagnostic mode also does not help to reveal any additional information on the crowd navigation sample when it segfaulted during test.

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
87f408be51
3 changed files with 9 additions and 6 deletions
  1. 1 2
      .travis.yml
  2. 3 3
      Rakefile
  3. 5 1
      Source/Samples/CMakeLists.txt

+ 1 - 2
.travis.yml

@@ -144,8 +144,7 @@ environment:
 # Using neither-in-nor-out-of-source (Urho3D-legacy) build tree when on AppVeyor; using out-of-source (and in-the-source) build tree when on Travis-CI for test coverage
 # Using neither-in-nor-out-of-source (Urho3D-legacy) build tree when on AppVeyor; using out-of-source (and in-the-source) build tree when on Travis-CI for test coverage
   build_tree: Build
   build_tree: Build
   config: Release
   config: Release
-  excluded_sample: PLATFORM=x64 01_HelloWorld,02_HelloGUI,03_Sprites,04_StaticScene,05_AnimatingScene,06_SkeletalAnimation,07_Billboards,08_Decals,09_MultipleViewports,10_RenderToTexture,11_Physics,12_PhysicsStressTest,13_Ragdolls,14_SoundEffects,15_Navigation,16_Chat,17_SceneReplication,18_CharacterDemo,19_VehicleDemo,20_HugeObjectCount,21_AngelScriptIntegration,22_LuaIntegration,23_Water,24_Urho2DSprite,25_Urho2DParticle,26_ConsoleInput,27_Urho2DPhysics,28_Urho2DPhysicsRope,29_SoundSynthesis,30_LightAnimation,31_MaterialAnimation,32_Urho2DConstraints,33_Urho2DSpriterAnimation,34_DynamicGeometry,35_SignedDistanceFieldText,36_Urho2DTileMap,37_UIDrag,38_SceneAndUILoad,40_Localization,41_DatabaseDemo
-  verbosity: diagnostic
+  included_sample: PLATFORM=x64 39_CrowdNavigation
 # We cannot afford to have a large matrix on AppVeyor at the moment
 # We cannot afford to have a large matrix on AppVeyor at the moment
   URHO3D_D3D11: 1
   URHO3D_D3D11: 1
   matrix:
   matrix:

+ 3 - 3
Rakefile

@@ -307,15 +307,15 @@ task :ci do
   # Obtain our custom data, if any
   # Obtain our custom data, if any
   if ENV['APPVEYOR']
   if ENV['APPVEYOR']
     # AppVeyor does not provide job number environment variable in the same semantics as TRAVIS_JOB_NUMBER nor it supports custom data in its .appveyor.yml document
     # AppVeyor does not provide job number environment variable in the same semantics as TRAVIS_JOB_NUMBER nor it supports custom data in its .appveyor.yml document
-    if ENV['excluded_sample']
-      pairs = ENV['excluded_sample'].split
+    if ENV['included_sample'] || ENV['excluded_sample']   # Inclusion has higher precedence
+      pairs = (ENV['included_sample'] || ENV['excluded_sample']).split
       samples = pairs.pop.split ','
       samples = pairs.pop.split ','
       matched = true
       matched = true
       pairs.each { |pair|
       pairs.each { |pair|
         kv = pair.split '='
         kv = pair.split '='
         matched = false if ENV[kv.first] != kv.last
         matched = false if ENV[kv.first] != kv.last
       }
       }
-      samples.each { |name| ENV["EXCLUDE_SAMPLE_#{name}"] = '1' } if matched
+      samples.each { |name| ENV["#{ENV['included_sample'] ? 'INCLUDED' : 'EXCLUDED'}_SAMPLE_#{name}"] = '1' } if matched
     end
     end
   else
   else
     data = YAML::load(File.open('.travis.yml'))['data']
     data = YAML::load(File.open('.travis.yml'))['data']

+ 5 - 1
Source/Samples/CMakeLists.txt

@@ -35,7 +35,11 @@ set (INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
 
 
 # Macro for adding sample subdirectory
 # Macro for adding sample subdirectory
 macro (add_sample_subdirectory SOURCE_DIR)
 macro (add_sample_subdirectory SOURCE_DIR)
-    if (NOT DEFINED ENV{EXCLUDE_SAMPLE_${SOURCE_DIR}})
+    if (DEFINED ENV{included_sample})
+        if (DEFINED ENV{INCLUDED_SAMPLE_${SOURCE_DIR}})
+            add_subdirectory (${SOURCE_DIR} ${ARGN})
+        endif ()
+    elseif (NOT DEFINED ENV{EXCLUDED_SAMPLE_${SOURCE_DIR}})
         add_subdirectory (${SOURCE_DIR} ${ARGN})
         add_subdirectory (${SOURCE_DIR} ${ARGN})
     endif ()
     endif ()
 endmacro ()
 endmacro ()