@@ -77,11 +77,13 @@ test_script:
   #- Test\test-ipy-tc.cmd /category:Languages\IronPython\IronPython\2.X
 
 # to run custom scripts after tests
-after_test:
+#after_test:
   # upload results to AppVeyor
-  # NOTE: does not happen when test_script above aborts.
-  # Workaround in that case is to add to "on_finish:" to force an upload
-  - ps: $wc = New-Object 'System.Net.WebClient'; $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Test\TestResult.xml))
+  # NOTE: our test runner returns an exit code with number of failures
+  # AppVeyor misinterprets that and does not upload test results
+  # Workaround in that case is to add to "on_failure:" and "on_success:"
+  # to force an upload
+  #- ps: $wc = New-Object 'System.Net.WebClient'; $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Test\TestResult.xml))
 
 #---------------------------------#
 #      artifacts configuration    #
@@ -129,12 +131,14 @@ after_test:
 #---------------------------------#
 
 # on successful build
-#on_success:
-#  - do something
+on_success:
+  # upload test results to AppVeyor
+  - ps: $wc = New-Object 'System.Net.WebClient'; $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Test\TestResult.xml))
 
 # on build failure
-#on_failure:
-#  - do something
+on_failure:
+  # upload test results to AppVeyor
+  - ps: $wc = New-Object 'System.Net.WebClient'; $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\Test\TestResult.xml))
 
 # after build failure or success
 #on_finish: