Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
887 B

  1. use Cwd;
  2. my $dir = getcwd;
  3. chdir "../../../game";
  4. if( 1 )
  5. {
  6. system "rd /s /q ep2\\screenshots";
  7. system "mkdir ep2\\screenshots";
  8. @output = `hl2.exe -allowdebug -autoconfig -console -toconsole -dev -sw -width 1024 -game ep2 -testscript rendering_regression_test.vtest`;
  9. }
  10. $keydir = "\\\\fileserver\\user\\rendering_regression_test";
  11. open TESTSCRIPT, "<ep2/testscripts/rendering_regression_test.vtest" || die;
  12. foreach $line (<TESTSCRIPT>)
  13. {
  14. $line =~ s,//.*,,g; # remove comments
  15. if( $line =~ m/\s*screenshot\s+(.*)$/i )
  16. {
  17. push @screenshots, $1;
  18. }
  19. }
  20. close TESTSCRIPT;
  21. foreach $screenshot (@screenshots)
  22. {
  23. $cmd = "tgamse $keydir\\$screenshot.tga ep2\\screenshots\\$screenshot.tga 0";
  24. $output = `$cmd`;
  25. if( $output =~ m/FAIL/ )
  26. {
  27. $cmd = "tgadiff $keydir\\$screenshot.tga ep2\\screenshots\\$screenshot.tga ep2\\screenshots\\$screenshot" . "_diff.tga";
  28. system $cmd;
  29. }
  30. }