Add a new testing target: check-one. It is used like this:
authorReid Spencer <rspencer@reidspencer.com>
Sun, 15 Apr 2007 06:18:50 +0000 (06:18 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 15 Apr 2007 06:18:50 +0000 (06:18 +0000)
make check-one TESTONE=test/path/to/test.ll

This runs a single check in exactly the same way that dejagnu runs it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36049 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile
test/Makefile

index a13be8ae0a3ab622edec2c011f8bfa8e81c2c9d6..c8604daf74e47765361c77a70fb3415ab9acb2c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -113,6 +113,9 @@ endif
 check-llvm2cpp:
        $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
 
+check-one:
+       $(MAKE) -C test check-one TESTONE=$(TESTONE)
+
 srpm: $(LLVM_OBJ_ROOT)/llvm.spec 
        rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec
 
index 001e3ac62f5bad7088f09510d5de1976662d5fb8..7c8a7b3bd721520251340d1bcd0b3be8dae42cf3 100644 (file)
@@ -42,6 +42,25 @@ check-local:: site.exp
        @echo "*** dejagnu not found.  Make sure runtest is in your PATH, then reconfigure llvm."
 endif
 
+ifdef TESTONE
+CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
+CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
+SUBDIR := $(shell dirname $(CLEANED_TESTONE))
+TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
+check-one: site.exp $(TCLSH)
+       @( echo "source $(LLVM_SRC_ROOT)/test/site.exp" ; \
+         echo "set subdir $(SUBDIR)" ; \
+         echo "proc pass  { msg } { puts \"PASS: \$$msg\" } "; \
+         echo "proc fail  { msg } { puts \"FAIL: \$$msg\" }" ; \
+         echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
+         echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
+         echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
+         echo "RunLLVMTests $(TESTPATH)" ) | \
+       ( ulimit -t 600 ; ulimit -d 512000 ; \
+         PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
+         $(TCLSH) )
+endif
+
 clean::
        $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`