From: Garrett C. <ris...@li...> - 2010-07-04 12:30:31
|
The branch, pu, has been updated via 038138be7d47a1b38cf44baa7d30e8ed0c700d3e (commit) via bb34ec782689243aeba8dca930c3a783cdf89bcf (commit) from 2d87d5da9dfcda98b5c5cd41d45b924910aad1bd (commit) - Log ----------------------------------------------------------------- commit 038138be7d47a1b38cf44baa7d30e8ed0c700d3e Author: Garrett Cooper <yan...@gm...> Date: Sun Jul 4 05:24:20 2010 -0700 General purpose cleanup. */Makefile Fix the filenames for some testcases to make them buildonly instead of using the previous non-build filename. interfaces/pthread_create/testfrmw.c: fix the #include's so it compiles properly. Signed-off-by: Garrett Cooper <yan...@gm...> commit bb34ec782689243aeba8dca930c3a783cdf89bcf Author: Garrett Cooper <yan...@gm...> Date: Sun Jul 4 05:03:32 2010 -0700 Improve output and notify of test naming issues. The output now better matches the previous code (but not exactly because I've simplified the problem into compile, instead of cc/ld failures for simplicity in the make rules). Test naming is wrong for a boatload of tests (some tests are buildonly, but it turns out they have a main so they can be run (and most of the case) the other way around. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../definitions/aio_h/{1-1.c => 1-1-buildonly.c} | 0 .../definitions/aio_h/{1-2.c => 1-2-buildonly.c} | 0 .../definitions/aio_h/{3-1.c => 3-1-buildonly.c} | 0 .../definitions/errno_h/{1-1.c => 1-1-buildonly.c} | 0 .../definitions/errno_h/{2-1.c => 2-1-buildonly.c} | 0 .../definitions/errno_h/{3-1.c => 3-1-buildonly.c} | 0 .../sigaddset/{4-core-buildonly.c => 4-core.c} | 0 .../scripts/generate-makefiles.sh | 39 ++++++++++++++++++-- 8 files changed, 36 insertions(+), 3 deletions(-) rename testcases/open_posix_testsuite/conformance/definitions/aio_h/{1-1.c => 1-1-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/definitions/aio_h/{1-2.c => 1-2-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/definitions/aio_h/{3-1.c => 3-1-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/definitions/errno_h/{1-1.c => 1-1-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/definitions/errno_h/{2-1.c => 2-1-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/definitions/errno_h/{3-1.c => 3-1-buildonly.c} (100%) rename testcases/open_posix_testsuite/conformance/interfaces/sigaddset/{4-core-buildonly.c => 4-core.c} (100%) diff --git a/testcases/open_posix_testsuite/conformance/definitions/aio_h/1-1.c b/testcases/open_posix_testsuite/conformance/definitions/aio_h/1-1-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/aio_h/1-1.c rename to testcases/open_posix_testsuite/conformance/definitions/aio_h/1-1-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/definitions/aio_h/1-2.c b/testcases/open_posix_testsuite/conformance/definitions/aio_h/1-2-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/aio_h/1-2.c rename to testcases/open_posix_testsuite/conformance/definitions/aio_h/1-2-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/definitions/aio_h/3-1.c b/testcases/open_posix_testsuite/conformance/definitions/aio_h/3-1-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/aio_h/3-1.c rename to testcases/open_posix_testsuite/conformance/definitions/aio_h/3-1-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/1-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/1-1-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/errno_h/1-1.c rename to testcases/open_posix_testsuite/conformance/definitions/errno_h/1-1-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/2-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/2-1-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/errno_h/2-1.c rename to testcases/open_posix_testsuite/conformance/definitions/errno_h/2-1-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c rename to testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1-buildonly.c diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core-buildonly.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c similarity index 100% rename from testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core-buildonly.c rename to testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 80d2f25..bd23d27 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -81,7 +81,7 @@ generate_makefile() { # # Path variables. -top_srcdir?= $(echo "$(dirname "$filename")" | sed -E -e 's,[^/]+,\.\.,g') +top_srcdir?= $(echo "$prereq_cache_dir" | sed -E -e 's,[^/]+,\.\.,g') subdir= $prereq_cache_dir srcdir= \$(top_srcdir)/\$(subdir) @@ -93,6 +93,18 @@ CFLAGS+= -I\$(top_srcdir)/include EOF + for var in CFLAGS LDFLAGS LDLIBS; do + + if [ -f "$prereq_cache_dir/$var" ]; then + + cat >> "$makefile.1" <<EOF +$var+= `grep -v '^#' 2>/dev/null $prereq_cache_dir/$var` + +EOF + fi + + done + cat > "$makefile.3" <<EOF all: \$(MAKE_TARGETS) @@ -125,10 +137,31 @@ EOF # needs it. for prereq in ${make_target_prereq_cache}; do - c_file=$(echo "$prereq" | sed -e "s,\.$suffix,\.c,") + test_name=$(echo "$prereq" | sed -e "s,\.$suffix,,") + c_file="$test_name.c" + + case "$suffix" in + run-test) + grep -q 'main' "$prereq_cache_dir/$c_file" || echo >&2 "$prereq_cache_dir/$c_file should be test." + ;; + test) + grep -q 'main' "$prereq_cache_dir/$c_file" && echo >&2 "$prereq_cache_dir/$c_file should be run-test." + ;; + esac + + COMPILE_STR="\$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file \$(LDLIBS)" + cat >> "$makefile.4" <<EOF + $prereq: \$(srcdir)/$c_file - \$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file \$(LDLIBS) + @if $COMPILE_STR >logfile.\$\$\$\$ 2>&1; then \\ + echo "$prereq_cache_dir/$test_name compile PASSED"; \\ + echo "$prereq_cache_dir/$test_name compile PASSED" >> \$(LOGFILE); \\ + else \\ + echo "$prereq_cache_dir/$test_name compile FAILED"; \\ + (echo "$prereq_cache_dir/$test_name compile FAILED"; cat logfile.\$\$\$\$) >> \$(LOGFILE); \\ + fi; \\ + rm -f logfile.\$\$\$\$ EOF done hooks/post-receive -- ltp |