]> granicus.if.org Git - graphviz/commitdiff
Redirect stderr to stdout for python unittest
authorMark Hansen <mark@markhansen.co.nz>
Fri, 22 May 2020 04:42:55 +0000 (14:42 +1000)
committerMark Hansen <mark@markhansen.co.nz>
Fri, 22 May 2020 08:07:37 +0000 (18:07 +1000)
Powershell fails the entire batch file if it sees any output on stderr.

Migrated to powershell because batch files are old, I don't really want
to use batch.

appveyor.yml
tests/regression_tests/regression_tests.bat [deleted file]
tests/regression_tests/regression_tests.ps1 [new file with mode: 0644]

index 3551bf9cced236677e1051936c40fb94155885db..f1d62e58f343d776f560e818f72687005e59d269 100644 (file)
@@ -76,7 +76,7 @@ build_script:
         $env:Path = $env:APPVEYOR_BUILD_FOLDER + "\" + $env:configuration + "\Graphviz\bin" + ";" + $env:Path;
         dot -c;
         cd tests\regression_tests;
-        ./regression_tests.bat;
+        ./regression_tests.ps1;
       }
 
 artifacts:
diff --git a/tests/regression_tests/regression_tests.bat b/tests/regression_tests/regression_tests.bat
deleted file mode 100644 (file)
index a076e83..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-@ECHO OFF
-
-pushd shapes
-python shapes.py
-popd
-
-REM Larger graph testing
-# FIXME: re-enable when https://gitlab.com/graphviz/graphviz/-/issues/1710 is fixed
-#python -m unittest discover large
diff --git a/tests/regression_tests/regression_tests.ps1 b/tests/regression_tests/regression_tests.ps1
new file mode 100644 (file)
index 0000000..b9e05b1
--- /dev/null
@@ -0,0 +1,10 @@
+Push-Location shapes
+python shapes.py
+Pop-Location
+
+# Larger graph testing
+# Python unittest prints to stderr, but Powershell interprets stderr
+# messages as an error, failing the pipeline. So we must redirect
+# stderr to stdout. The line noise at the end does so. See
+# https://stackoverflow.com/a/20950421/171898 for explanation.
+python -m unittest discover large 2>&1 | %{ "$_" }