[CMake] redirecting standard input in a test

Alcino Dall'Igna Jr adijbr at gmail.com
Sun Jul 9 19:33:43 EDT 2006


Hi

How do I wrote an ADD_TEST command so a program reading standard input
could be redirected to a file?

I try:

ADD_TEST(t build/Debug/tcmake < data)

as it should be in linux, but it doesn't work. The program still
executes fine but does not understand that the input should be
redirected to the 'data' file.

cmake 2.4.2 in linux.

this is the DartTestfile.txt:

# CMake generated Testfile for
# Source directory: <edited...>/tcmake
# Build directory: <edited...>/tcmake
#
# This file replicates the SUBDIRS() and ADD_TEST() commands from the source
# tree CMakeLists.txt file, skipping any SUBDIRS() or ADD_TEST() commands
# that are excluded by CMake control structures, i.e. IF() commands.
#
# The next line is critical for Dart to work
# Duh :-)

ADD_TEST(t "build/Debug/tcmake" "<" "data")
SUBDIRS(build)


More information about the CMake mailing list