xref: /netbsd-src/external/gpl3/gcc/dist/libstdc++-v3/scripts/create_testsuite_files (revision b1e838363e3c6fc78a55519254d99869742dd33c)
14fee23f9Smrg#!/bin/sh
24fee23f9Smrg
34fee23f9Smrg# Constructs lists of source files (full pathnames) to test.  Two
44fee23f9Smrg# files are constructed: testsuite_files, which is used to test with
54fee23f9Smrg# the default dg-runtest command, and testsuite_files_interactive,
64fee23f9Smrg# which is used to test cases that require input to be entered. In
74fee23f9Smrg# addition, both lists are pruned of wchar_t tests if the toolchain
84fee23f9Smrg# under test does not support wchar_t functionality.
94fee23f9Smrg#
104fee23f9Smrg# We mimic the mkcheck script in that the first time this is run, all
114fee23f9Smrg# existing files are listed in "testsuite_files" in the output
124fee23f9Smrg# directory.  Subsequent runs pull the list from that file, allowing
134fee23f9Smrg# users to trim the list down to problematic tests, or just run
14181254a7Smrg# particular directories or sub-directories of tests.
154fee23f9Smrg#
164fee23f9Smrg# Selecting individual tests can also be done with RUNTESTFLAGS, but
174fee23f9Smrg# that doesn't really do all that we are trying to accomplish here.
184fee23f9Smrg
194fee23f9SmrgLC_ALL=C
204fee23f9Smrgexport LC_ALL
214fee23f9Smrg
224fee23f9Smrg# Both of these are in the appropriate testsuite subdirectories.
234fee23f9Smrgsrcdir="$1"
244fee23f9Smrgoutdir="$2"
254fee23f9Smrg
264fee23f9Smrgtmp="${TMPDIR:-/tmp}/ctt$$"
274fee23f9Smrgtests_file_normal="$outdir/testsuite_files"
284fee23f9Smrgtests_file_inter="$outdir/testsuite_files_interactive"
294fee23f9Smrgtests_file_perf="$outdir/testsuite_files_performance"
30*b1e83836Smrgtests_file_simd="$outdir/testsuite_files_simd"
314fee23f9Smrg
324fee23f9Smrgcd $srcdir
334fee23f9Smrg# This is the ugly version of "everything but the current directory".  It's
344fee23f9Smrg# what has to happen when find(1) doesn't support -mindepth, or -xtype.
35181254a7Smrg# The directories here should be consistent with libstdc++-dg/conformance.exp
364fee23f9Smrgdlist=`echo [0-9][0-9]*`
37fb8a8121Smrgdlist="$dlist std abi backward ext performance tr1 tr2 decimal experimental"
38181254a7Smrgdlist="$dlist special_functions"
394fee23f9Smrgfind $dlist "(" -type f -o -type l ")" -name "*.cc" -print > $tmp.01
404fee23f9Smrgfind $dlist "(" -type f -o -type l ")" -name "*.c" -print > $tmp.02
414fee23f9Smrgcat  $tmp.01 $tmp.02 | sort > $tmp.1
424fee23f9Smrgif test ! -s "$tmp.1"; then
434fee23f9Smrg  exit 1
444fee23f9Smrgfi
454fee23f9Smrg
464fee23f9Smrg# Now filter out classes of tests.  These classes are run using special rules.
474fee23f9Smrggrep _xin $tmp.1 > $tests_file_inter
484fee23f9Smrggrep -v _xin $tmp.1 > $tmp.4
494fee23f9Smrg
504fee23f9Smrggrep performance $tmp.4 > $tests_file_perf
514fee23f9Smrggrep -v performance $tmp.4 > $tmp.5
524fee23f9Smrg
53*b1e83836Smrggrep simd/tests/ $tmp.5 > $tests_file_simd
54*b1e83836Smrggrep -v simd/tests/ $tmp.5 > $tmp.6
55*b1e83836Smrg
564fee23f9Smrg# ...more filters go here.
57*b1e83836Smrgcp $tmp.6 $tests_file_normal
584fee23f9Smrg
594fee23f9Smrgrm $tmp*
604fee23f9Smrgexit 0
61