#! /bin/sh # Copyright (c) 2002, Intel Corporation. All rights reserved. # Created by: inaky.perez-gonzalez REMOVE-THIS AT intel DOT com # This file is licensed under the GPLv2 license. For the full content # of this license, see the COPYING file at the top level of this # source tree. usage() { cat <&2 "Unknown option: $1" usage >&2 exit 1 ;; *) break ;; esac done # Simple version right now, just locate all: WHERE=${1:-.} # Need the DIRECTORY arg ... if [ ! -d "$WHERE" ]; then echo >&2 "Error: $WHERE: no such directory" exit 1 elif [ "x$mode" = x ]; then echo >&2 "Error: no options specified" usage >&2 exit 1 fi case "$mode" in buildonly) find "$WHERE" -type f -name "*.c" | grep buildonly ;; runnable) # XXX (garrcoop): the tools part is a hack to ensure that we don't # waltz down the tools directory and try and build t0 (which doesn't # make sense as it's a tool, not a test). Better criterion needs to # be established for this file. find "$WHERE/conformance" "$WHERE/stress" -type f -name '*[0-9].c' -o -name '[0-9]*-[0-9]*.sh' | grep -v buildonly | grep -v '^./tools' find "$WHERE/functional" -type f -name '*.c' ;; test-tools) find "$WHERE" -type f -name '*-core.c' ;; esac