On 27 May 2015 at 22:27, Arthur Schwarz <aschwarz1...@att.net> wrote: > Then is seems that the test harness would have to do: > cat data | tap-driver.sh > ./script.sh | tap-driver.sh > > Because the awk loop in tap-driver.sh does a getline which reads from an > input pipe (stdin). Have I read the code and the document correctly? This is > really confusing to me. In 15.3.3.1 Command-line arguments for test drivers > the manual says "The first non-option argument passed to the test driver is > the program to be run, and all the following ones are command-line options > and arguments for this program." Which seems to mean that for custom drivers > we get for:
In Makefile we have something like: .t.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(T_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_T_LOG_DRIVER_FLAGS) $(T_LOG_DRIVER_FLAGS) -- $(T_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) The 'tst' shell variable is set inside 'am__check_pre' and is the name of the test case. In tap-driver.sh there is: "$@" echo $? ) | LC_ALL=C ${AM_TAP_AWK-awk} \ -v me="$me" \ -v test_script_name="$test_name" \ -v log_file="$log_file" \ -v trs_file="$trs_file" \ -v expect_failure="$expect_failure" \ -v merge="$merge" \ -v ignore_exit="$ignore_exit" \ -v comments="$comments" \ -v diag_string="$diag_string" \ ' That final apostrophe is very important to notice: it is the start of the awk script. The "$@" line executes the test case. This was all the arguments given to the tap-driver.sh in the Makefile, but now all the options have been shift'd. So the output of the test case is the input of awk, via the pipe (|).