home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / t / comp / cpp.aux < prev    next >
Text File  |  2000-03-16  |  571b  |  36 lines

  1. #!./perl -P
  2.  
  3. print "1..3\n";
  4.  
  5. #define MESS "ok 1\n"
  6. print MESS;
  7.  
  8. #ifdef MESS
  9.     print "ok 2\n";
  10. #else
  11.     print "not ok 2\n";
  12. #endif
  13.  
  14. open(TRY,">Comp.cpp.tmp") || die "Can't open temp perl file.";
  15.  
  16. ($prog = <<'END') =~ s/X//g;
  17. X$ok = "not ok 3\n";
  18. X#include "Comp.cpp.inc"
  19. X#ifdef OK
  20. X$ok = OK;
  21. X#endif
  22. Xprint $ok;
  23. END
  24. print TRY $prog;
  25. close TRY;
  26.  
  27. open(TRY,">Comp.cpp.inc") || (die "Can't open temp include file.");
  28. print TRY '#define OK "ok 3\n"' . "\n";
  29. close TRY;
  30.  
  31. $pwd=`pwd`;
  32. $pwd =~ s/\n//;
  33. $x = `./perl -P Comp.cpp.tmp`;
  34. print $x;
  35. unlink "Comp.cpp.tmp", "Comp.cpp.inc";
  36.