]> granicus.if.org Git - graphviz/commitdiff
Set up VCTools also for MSBuild tests
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 28 Jul 2020 15:51:39 +0000 (17:51 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 30 Jul 2020 14:11:12 +0000 (16:11 +0200)
The solution comes from https://stackoverflow.com/a/2128350/3122101

.gitlab-ci.yml

index fd91e85679d08106f6283d17eea433f83d1d495c..05de48e6ee919f203c7b884f7353b185120f3bb4 100644 (file)
@@ -113,6 +113,14 @@ portable-source:
               }
             }
         # Test
+        # Set up VCTools variables and import into PowerShell environment
+        - cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat`" $TARGET_ARCH && set > %temp%\vcvars.txt";
+        - >-
+            Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
+              if ($_ -match "^(.*?)=(.*)$") {
+                Set-Content "env:\$($matches[1])" $matches[2];
+              }
+            }
         - >-
             if($env:build_system -eq "cmake" -and $env:configuration -eq "Release") {
               cd build;
@@ -130,12 +138,6 @@ portable-source:
               dot -c;
               ctest -C $env:configuration;
               cd ..;
-              cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat`" $TARGET_ARCH && set > %temp%\vcvars.txt";
-              Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
-                if ($_ -match "^(.*?)=(.*)$") {
-                  Set-Content "env:\$($matches[1])" $matches[2];
-                }
-              }
               $Env:INCLUDE += ";C:\Graphviz\include";
               $Env:LIB += ";C:\Graphviz\lib";
               pytest -s rtest\test_examples.py;