GenerateRandomOutput.cmake 664 B

12345678910111213141516171819202122232425262728293031
  1. #
  2. # This script generates random lines of output.
  3. #
  4. # By default, it generates 100M of output (a million lines of 100 bytes each),
  5. # but you can override that by passing in -D line_count and/or -D line_size...
  6. #
  7. # Default values:
  8. #
  9. if(NOT DEFINED line_count)
  10. set(line_count 1000000)
  11. endif()
  12. if(NOT DEFINED line_size)
  13. set(line_size 100)
  14. endif()
  15. if(NOT DEFINED random_seed)
  16. set(random_seed 1987)
  17. endif()
  18. # Use RANDOM_SEED once before the loop:
  19. #
  20. string(RANDOM LENGTH ${line_size} RANDOM_SEED ${random_seed} s)
  21. # Emit line_count lines of random output:
  22. #
  23. foreach(i RANGE 1 ${line_count})
  24. string(RANDOM LENGTH ${line_size} s)
  25. message(${s})
  26. endforeach()