anchor.diff:  
   :: -----------------------------------------------------------------------------
   :gtests
  -    echo [90m"%pmdir%\%pmtest%" %*[0m
  -    "%pmdir%\%pmtest%" %*
  +    echo [90m"%pmdir%\build\%test_config%\PresentMonTests-%version%-x64.exe" %*[0m
  +    "%pmdir%\build\%test_config%\PresentMonTests-%version%-x64.exe" %*
       if not "%errorlevel%"=="0" set /a errorcount=%errorcount%+1
       exit /b 0
   
  
positive.code: set use_debug_config=1
  set use_release_config=1
  set do_build=1
  set do_default_gtests=1
  set errorcount=0
  :args_begin
  
negative.code:         exit /b 0
      )
  
      start /b "" "%~dp0PresentBench.exe" %* >NUL
      for /f "tokens=1,2 delims=:" %%a in ('tasklist /fi "imagename eq PresentBench.exe" /fo list') do (
          if "%%a" EQU "PID" (
              set /a started_target_app_pid=%%b
              exit /b 0
          )
      )
      exit /b 0
  
  :stop_target_app
      if %started_target_app_pid% EQU 0 exit /b 0
      taskkill /PID %started_target_app_pid% >NUL
      :until_killed
          call :is_app_running /fi "imagename eq PresentBench.exe" /fi "pid eq %started_target_app_pid%"
          if %errorlevel% NEQ 0 goto until_killed
      set started_target_app_pid=0
      exit /b 0
  
  :is_app_running
      for /f "tokens=1,2 delims=:" %%a in ('tasklist %* /fo list') do (
          if "%%a" EQU "PID" exit /b 1
      )
      exit /b 0
  
  :: -----------------------------------------------------------------------------
  :realtime_test
      set test_api=%~1
      set expected_runtime=%~2
  
      call :start_target_app /width=320 /height=240 /api=%test_api%
      if %errorlevel% NEQ 0 (
          echo [31merror: realtime tests cannot run with a process named PresentBench.exe already running[0m
          set /a errorcount=%errorcount%+1
          exit /b 0
      )
  
      set saw_row=0
      set saw_error=0
      set present_mode=
      for /f "tokens=4,12 delims=," %%a in ('"%pmdir%\build\%test_config%\PresentMon-%version%-x64.exe" -process_id %started_target_app_pid% -output_stdout -timed 2 -terminate_after_timed 2^>NUL') do (
          if "%%a" NEQ "Runtime" (
              if !saw_row! EQU 0 (
                  set present_mode=%%b
                  set saw_row=1
              )
              if "%%a" NEQ "%expected_runtime%" (
                  if !saw_error! EQU 0 (
                      echo [31merror: expecting runtime "%expected_runtime%", but got "%%a"[0m
                      set saw_error=1
                  )
              )
          )
      )
  
      call :stop_target_app
  
      if %saw_error% NEQ 0 (
          set /a errorcount=%errorcount%+1
          exit /b 0
      )
      if %saw_row% EQU 0 (
          echo [31merror: realtime tests did not record any presents[0m
          set /a errorcount=%errorcount%+1
          exit /b 0
      )
  
      echo.   [90m%test_api%: %expected_runtime%, %present_mode%[0m
      exit /b 0
  
  