tester.bat 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @echo off
  2. rem file : tester.bat
  3. rem copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC
  4. rem license : MIT; see accompanying LICENSE file
  5. rem
  6. rem Run test or example. The test/example directory is the current directory.
  7. rem
  8. rem %1 "test" or "example"
  9. rem %2 configuration, for example, Debug or Release
  10. rem %3 platform, for example Win32 or x64
  11. rem topdir variable containing the path to top project directory
  12. rem
  13. setlocal
  14. set "PATH=%topdir%\bin64;%topdir%\bin;%PATH%"
  15. if "_%DIFF%_" == "__" set DIFF=fc
  16. if "_%3_" == "_Win32_" (
  17. set "dir=%2"
  18. ) else (
  19. set "dir=%3\%2"
  20. )
  21. rem Globbing returns files in alphabetic order.
  22. rem
  23. if exist *.xml (
  24. for %%f in (*.xml) do (
  25. if "_%1_" == "_example_" (
  26. %dir%\driver.exe %%f
  27. ) else (
  28. %dir%\driver.exe %%f >test.out
  29. )
  30. if errorlevel 1 (
  31. del /f test.out
  32. goto error
  33. )
  34. if "_%1_" == "_test_" (
  35. %DIFF% %%f test.out
  36. if errorlevel 1 (
  37. del /f test.out
  38. goto error
  39. )
  40. del /f test.out
  41. )
  42. )
  43. ) else (
  44. %dir%\driver.exe
  45. if errorlevel 1 goto error
  46. )
  47. goto end
  48. :error
  49. endlocal
  50. exit /b 1
  51. :end
  52. endlocal