Greetings all.

One of my recent projects has been working on modifications to some of the internal build processes related to standard library. One of these modifications has been to include the building of certain 'legacy' tests as part of the stdcxx nightly build process. These tests rely on a framework internal to RogueWave, and aren't included in the subversion tree. An ongoing project has been porting these tests to the stdcxx test driver, but there are something around 100 of these tests left to be ported.

These tests are the reason for the existence of the --compat switch in the rwtest library and the exec utility. The purpose is to allow us to run the stdcxx test suite within the RogueWave internal infrastructure, and the legacy tests within the makefile infrastructure. When the rwtest library is in compatibility mode, it allows users to specify an additional small set of switches on the command line. Most of these switches are placeholders, but the -O switch allows redirection of output to an arbitrary file.

At this time, there is an important behavior difference between the legacy tests and the rwtest library. With the rwtest library, all output is routed to stderr/stdout. However, with the legacy tests, the output is routed by default to the .out file which the exec utility redirects the output to. Unfortunately, this dual usage of the file seems to result in a clearing/clobbering of the output file, resulting in a loss of results and a FORMAT status message. For these tests to be useful, we need to resolve this problem.

One (faulty) option would be to use the -O switch in compatability mode, and provide it with a file such as /dev/stdout or /dev/fd/1. On systems where these 'magic' files exist, they reference the standard out file descriptor. However, the existence of such a file can't be relied on, so we can't use them. A similar magic file is /dev/tty, which is a file descriptor pointing at the active console. For the child process from the exec utility, there is no associated console, so there is no place to route the output, leading to a failure.

A second method would be to alter the behavior of the test driver in --compat mode to write to the .out file, and alter the exec utility to redirect stderr and stdout to /dev/null in --compat mode.

A final method would be to alter the rwtest library to treat the file name of '-' when passed to the -O option as stdout, and make a similar change to the RogueWave internal framework, then run the executables with the options '--compat -O -'. This would likely be less invasive than the other option, and could be considered a useful enhancement.

What thoughts do other people have on this?

--Andrew Black

Reply via email to