xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/scripts/create_testsuite_files (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg#!/bin/sh
236ac495dSmrg
336ac495dSmrg# Constructs lists of source files (full pathnames) to test.  Two
436ac495dSmrg# files are constructed: testsuite_files, which is used to test with
536ac495dSmrg# the default dg-runtest command, and testsuite_files_interactive,
636ac495dSmrg# which is used to test cases that require input to be entered. In
736ac495dSmrg# addition, both lists are pruned of wchar_t tests if the toolchain
836ac495dSmrg# under test does not support wchar_t functionality.
936ac495dSmrg#
1036ac495dSmrg# We mimic the mkcheck script in that the first time this is run, all
1136ac495dSmrg# existing files are listed in "testsuite_files" in the output
1236ac495dSmrg# directory.  Subsequent runs pull the list from that file, allowing
1336ac495dSmrg# users to trim the list down to problematic tests, or just run
14c0a68be4Smrg# particular directories or sub-directories of tests.
1536ac495dSmrg#
1636ac495dSmrg# Selecting individual tests can also be done with RUNTESTFLAGS, but
1736ac495dSmrg# that doesn't really do all that we are trying to accomplish here.
1836ac495dSmrg
1936ac495dSmrgLC_ALL=C
2036ac495dSmrgexport LC_ALL
2136ac495dSmrg
2236ac495dSmrg# Both of these are in the appropriate testsuite subdirectories.
2336ac495dSmrgsrcdir="$1"
2436ac495dSmrgoutdir="$2"
2536ac495dSmrg
2636ac495dSmrgtmp="${TMPDIR:-/tmp}/ctt$$"
2736ac495dSmrgtests_file_normal="$outdir/testsuite_files"
2836ac495dSmrgtests_file_inter="$outdir/testsuite_files_interactive"
2936ac495dSmrgtests_file_perf="$outdir/testsuite_files_performance"
3036ac495dSmrg
3136ac495dSmrgcd $srcdir
3236ac495dSmrg# This is the ugly version of "everything but the current directory".  It's
3336ac495dSmrg# what has to happen when find(1) doesn't support -mindepth, or -xtype.
34c0a68be4Smrg# The directories here should be consistent with libstdc++-dg/conformance.exp
3536ac495dSmrgdlist=`echo [0-9][0-9]*`
36*8feb0f0bSmrgdlist="$dlist std abi backward ext performance tr1 tr2 decimal experimental"
37c0a68be4Smrgdlist="$dlist special_functions"
3836ac495dSmrgfind $dlist "(" -type f -o -type l ")" -name "*.cc" -print > $tmp.01
3936ac495dSmrgfind $dlist "(" -type f -o -type l ")" -name "*.c" -print > $tmp.02
4036ac495dSmrgcat  $tmp.01 $tmp.02 | sort > $tmp.1
4136ac495dSmrgif test ! -s "$tmp.1"; then
4236ac495dSmrg  exit 1
4336ac495dSmrgfi
4436ac495dSmrg
4536ac495dSmrg# Now filter out classes of tests.  These classes are run using special rules.
4636ac495dSmrggrep _xin $tmp.1 > $tests_file_inter
4736ac495dSmrggrep -v _xin $tmp.1 > $tmp.4
4836ac495dSmrg
4936ac495dSmrggrep performance $tmp.4 > $tests_file_perf
5036ac495dSmrggrep -v performance $tmp.4 > $tmp.5
5136ac495dSmrg
5236ac495dSmrg# ...more filters go here.
5336ac495dSmrgcp $tmp.5 $tests_file_normal
5436ac495dSmrg
5536ac495dSmrgrm $tmp*
5636ac495dSmrgexit 0
57