CMake/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake
David Cole a61c5ab6e5 Add CMAKE_TESTS_CDASH_SERVER variable and CTestSubmitLargeOutput test.
If defined and non-empty, the value of CMAKE_TESTS_CDASH_SERVER should point
to a CDash server willing to accept submissions for a project named
PublicDashboard. On machines that also run a CDash dashboard, set this
variable to "http://localhost/CDash-trunk-Testing" so that the CMake tests
that submit dashboards do not have to send those submissions over the wire.

The CTestSubmitLargeOutput test runs a dashboard that has a test that produces
very large amount of output on stdout/stderr. Since we do not even want	 to
attempt to send such large output over the wire, this test is off by default
unless the CMAKE_TESTS_CDASH_SERVER server is localhost. This test is expected
to cause a submission failure when sent to CDash. It passes if the submit
results contain error output. It fails if the submit succeeds.

CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.

If not defined or "", this variable defaults to the server at
http://www.cdash.org/CDash.

If set explicitly to "NOTFOUND", curl tests and ctest tests that use the
network are skipped.

If set to something starting with "http://localhost/", the CDash is expected
to be an instance of CDash used for CDash testing, pointing to a
cdash4simpletest database. In these cases, the CDash dashboards should be
run first.
2010-03-08 13:25:58 -05:00

32 lines
664 B
CMake

#
# This script generates random lines of output.
#
# By default, it generates 100M of output (a million lines of 100 bytes each),
# but you can override that by passing in -D line_count and/or -D line_size...
#
# Default values:
#
if(NOT DEFINED line_count)
set(line_count 1000000)
endif()
if(NOT DEFINED line_size)
set(line_size 100)
endif()
if(NOT DEFINED random_seed)
set(random_seed 1987)
endif()
# Use RANDOM_SEED once before the loop:
#
string(RANDOM LENGTH ${line_size} RANDOM_SEED ${random_seed} s)
# Emit line_count lines of random output:
#
foreach(i RANGE 1 ${line_count})
string(RANDOM LENGTH ${line_size} s)
message(${s})
endforeach()