about summary refs log tree commit diff homepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CXX/dg.exp3
-rw-r--r--test/Coverage/dg.exp3
-rw-r--r--test/Dogfood/dg.exp3
-rw-r--r--test/Expr/Lexer/dg.exp3
-rw-r--r--test/Expr/Parser/dg.exp3
-rw-r--r--test/Expr/dg.exp3
-rw-r--r--test/Feature/dg.exp3
-rw-r--r--test/Makefile66
-rw-r--r--test/Programs/dg.exp3
-rw-r--r--test/Runtime/POSIX/dg.exp5
-rw-r--r--test/Runtime/Uclibc/dg.exp5
-rw-r--r--test/Solver/dg.exp3
-rwxr-xr-xtest/TestRunner.sh37
-rw-r--r--test/lib/llvm.exp199
-rw-r--r--test/regression/dg.exp3
15 files changed, 10 insertions, 332 deletions
diff --git a/test/CXX/dg.exp b/test/CXX/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/CXX/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/test/Coverage/dg.exp b/test/Coverage/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/Coverage/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/test/Dogfood/dg.exp b/test/Dogfood/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/Dogfood/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/test/Expr/Lexer/dg.exp b/test/Expr/Lexer/dg.exp
deleted file mode 100644
index 94fc4df8..00000000
--- a/test/Expr/Lexer/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{pc}]]
diff --git a/test/Expr/Parser/dg.exp b/test/Expr/Parser/dg.exp
deleted file mode 100644
index 94fc4df8..00000000
--- a/test/Expr/Parser/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{pc}]]
diff --git a/test/Expr/dg.exp b/test/Expr/dg.exp
deleted file mode 100644
index 94fc4df8..00000000
--- a/test/Expr/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{pc}]]
diff --git a/test/Feature/dg.exp b/test/Feature/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/Feature/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/test/Makefile b/test/Makefile
index 23c891e4..c27ffad3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -11,7 +11,7 @@ LEVEL  = ..
 DIRS   = 
 
 #
-# Make Dejagnu the default for testing
+# Make llvm-lit the default for testing
 #
 all:: check-local
 
@@ -19,12 +19,12 @@ all:: check-local
 include Makefile.tests
 
 #===------------------------------------------------------------------------===#
-# DejaGNU testing support
+# llvm-lit testing support
 #===------------------------------------------------------------------------===#
+ULIMIT = ulimit -t 600 ; ulimit -d 512000 ;
 
 # FIXME: Fix test suite so we can run lit in parallel.
 ifdef VERBOSE
-RUNTESTFLAGS := $(VERBOSE)
 LIT_ARGS := -j1 -v
 else
 LIT_ARGS := -j1 -s -v
@@ -32,25 +32,14 @@ endif
 
 ifdef TESTSUITE
 LIT_TESTSUITE := $(TESTSUITE)
-CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
-CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
-RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
 else
 LIT_TESTSUITE := .
 endif
 
-ifneq ($(RUNTEST),)
-check-local:: site.exp
-	( ulimit -t 600 ; ulimit -d 512000 ; \
-	  PATH="$(ToolDir):$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
-	  $(RUNTEST) $(RUNTESTFLAGS) ;  \
-	  ! grep FAIL testrun.log; ! grep -q ^FAIL testrun.log;  )
-else
-check-local:: site.exp
-	@echo "*** dejagnu not found.  Make sure runtest is in your PATH, then reconfigure llvm."
-endif
+# Potential support in the future for multiple test suites
+LIT_ALL_TESTSUITES := $(LIT_TESTSUITE)
 
-check-local-lit:: lit.site.cfg
+check-local:: lit.site.cfg
 	# FIXME: Detect python at configure time
 	( $(ULIMIT) \
 	  python2 $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
@@ -58,26 +47,7 @@ check-local-lit:: lit.site.cfg
 check-local-all:: lit.site.cfg
 	# FIXME: Detect python at configure time
 	( $(ULIMIT) \
-	  python2 $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
-
-ifdef TESTONE
-CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
-CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
-SUBDIR := $(shell dirname $(CLEANED_TESTONE))
-TESTPATH := $(PROJ_SRC_ROOT)/test/$(CLEANED_TESTONE)
-check-one: site.exp $(TCLSH)
-	$(Verb)( echo "source $(PROJ_OBJ_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 $(PROJ_SRC_ROOT)/test/lib/llvm.exp" ; \
-	  echo "RunLLVMTests $(TESTPATH)" ) | \
-	( ulimit -t 600 ; ulimit -d 512000 ; \
-	  PATH="$(ToolDir):$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
-	  $(TCLSH) )
-endif
+	  python2 $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) )
 
 clean::
 	$(RM) -rf `find $(PROJ_OBJ_ROOT)/test -name Output -type d -print`
@@ -89,28 +59,6 @@ clean::
 	$(RM) -rf `find $(PROJ_OBJ_ROOT)/test -name test.log`
 	rm -f site.exp
 
-site.exp: Makefile $(LEVEL)/Makefile.config
-	@echo 'Making a new site.exp file...'
-	@echo '## these variables are automatically generated by make ##' >site.tmp
-	@echo '# Do not edit here.  If you wish to override these values' >>site.tmp
-	@echo '# edit the last section' >>site.tmp
-	@echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
-	@echo 'set ENABLE_UCLIBC "$(ENABLE_UCLIBC)"' >> site.tmp
-	@echo 'set ENABLE_POSIX_RUNTIME "$(ENABLE_POSIX_RUNTIME)"' >> site.tmp
-	@echo 'set TEST_FEATURE_LIST "$(TEST_FEATURE_LIST)"' >> site.tmp
-	@echo 'set srcroot "$(PROJ_SRC_ROOT)"' >>site.tmp
-	@echo 'set objroot "$(PROJ_OBJ_ROOT)"' >>site.tmp
-	@echo 'set srcdir "$(PROJ_SRC_ROOT)/test"' >>site.tmp
-	@echo 'set objdir "$(PROJ_OBJ_ROOT)/test"' >>site.tmp
-	@echo 'set llvmgcc "$(LLVMCC) -I$(PROJ_SRC_ROOT)/include"' >> site.tmp
-	@echo 'set llvmgxx "$(LLVMCXX) -I$(PROJ_SRC_ROOT)/include"' >> site.tmp
-	@echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
-	@test ! -f site.exp || \
-	sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
-	@-rm -f site.bak
-	@test ! -f site.exp || mv site.exp site.bak
-	@mv site.tmp site.exp
-
 lit.site.cfg: lit.site.cfg.in
 	@echo "Making KLEE 'lit.site.cfg' file..."
 	@sed -e "s#@KLEE_SOURCE_DIR@#$(PROJ_SRC_ROOT)#g" \
diff --git a/test/Programs/dg.exp b/test/Programs/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/Programs/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
diff --git a/test/Runtime/POSIX/dg.exp b/test/Runtime/POSIX/dg.exp
deleted file mode 100644
index 88406208..00000000
--- a/test/Runtime/POSIX/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [klee_supports_posix_runtime] } {
-    RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/test/Runtime/Uclibc/dg.exp b/test/Runtime/Uclibc/dg.exp
deleted file mode 100644
index 9c1663c3..00000000
--- a/test/Runtime/Uclibc/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [klee_supports_uclibc] } {
-    RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
-}
diff --git a/test/Solver/dg.exp b/test/Solver/dg.exp
deleted file mode 100644
index 94fc4df8..00000000
--- a/test/Solver/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{pc}]]
diff --git a/test/TestRunner.sh b/test/TestRunner.sh
index 3e2cace4..ab50856a 100755
--- a/test/TestRunner.sh
+++ b/test/TestRunner.sh
@@ -1,36 +1,5 @@
 #!/bin/sh
-#
-#  TestRunner.sh - This script is used to run the deja-gnu tests exactly like
-#  deja-gnu does, by executing the Tcl script specified in the test case's 
-#  RUN: lines. This is made possible by a simple make target supported by the
-#  test/Makefile. All this script does is invoke that make target. 
-#
-#  Usage:
-#     TestRunner.sh {script_names}
-#
-#     This script is typically used by cd'ing to a test directory and then
-#     running TestRunner.sh with a list of test file names you want to run.
-#
-TESTPATH=`pwd`
-SUBDIR=""
-if test `dirname $1` = "." ; then
-  while test `basename $TESTPATH` != "test" -a ! -z "$TESTPATH" ; do
-    tmp=`basename $TESTPATH`
-    SUBDIR="$tmp/$SUBDIR"
-    TESTPATH=`dirname $TESTPATH`
-  done
-fi
+# Deprecated, use 'llvm-lit'.
 
-for TESTFILE in "$@" ; do 
-  if test `dirname $TESTFILE` = . ; then
-    if test -d "$TESTPATH" ; then
-      cd $TESTPATH
-      make check-one TESTONE="$SUBDIR$TESTFILE"
-      cd $PWD
-    else
-      echo "Can't find klee/test directory in " `pwd`
-    fi
-  else
-    make check-one TESTONE=$TESTFILE
-  fi
-done
+echo "warning: '$0' is deprecated, use 'llvm-lit' instead."
+exec llvm-lit "$@"
diff --git a/test/lib/llvm.exp b/test/lib/llvm.exp
deleted file mode 100644
index ce52c4b5..00000000
--- a/test/lib/llvm.exp
+++ /dev/null
@@ -1,199 +0,0 @@
-# This procedure executes one line of a test case's execution script.
-proc execOneLine { test PRS outcome lineno line } {
-  set status 0
-  set resultmsg ""
-  set retval [ catch { eval exec -keepnewline -- $line } errmsg ]
-  if { $retval != 0 } {
-    set code [lindex $::errorCode 0]
-    set lineno [expr $lineno + 1]
-    if { $PRS != ""} {
-      set PRS " for $PRS" 
-    }
-    set errmsg " at line $lineno\nwhile running: $line\n$errmsg"
-    switch "$code" {
-      CHILDSTATUS {
-        set status [lindex $::errorCode 2]
-        if { $status != 0 } {
-          set resultmsg "$test$PRS\nFailed with exit($status)$errmsg"
-        }
-      }
-      CHILDKILLED {
-        set signal [lindex $::errorCode 2]
-        set resultmsg "$test$PRS\nFailed with signal($signal)$errmsg"
-      }
-      CHILDSUSP {
-        set signal [lindex $::errorCode 2]
-        set resultmsg "$test$PRS\nFailed with suspend($signal)$errmsg"
-      }
-      POSIX {
-        set posixNum [lindex $::errorCode 1]
-        set posixMsg [lindex $::errorCode 2]
-        set resultmsg "$test$PRS\nFailed with posix($posixNum,$posixMsg)$errmsg"
-      }
-      NONE {
-      }
-      default {
-      }
-    }
-  } 
-  return $resultmsg
-}
-
-# This procedure performs variable substitutions on the RUN: lines of a test
-# cases.
-proc substitute { line test tmpFile } {
-  global srcroot objroot srcdir objdir subdir target_triplet
-  global llvmgcc llvmgxx llvmgcc_version 
-  set path [file join $srcdir $subdir]
-
-  # Substitute all Tcl variables.
-  set new_line [subst $line ]
-
-  #replace %llvmgcc with actual path to llvmgcc
-  regsub -all {%llvmgcc} $new_line "$llvmgcc -emit-llvm" new_line
-  #replace %llvmgxx with actual path to llvmg++
-  regsub -all {%llvmgxx} $new_line "$llvmgxx -emit-llvm" new_line
-  #replace %klee with klee binary
-  regsub -all {%klee} $new_line "klee" new_line
-  #replace %kleaver with kleaver binary
-  regsub -all {%kleaver} $new_line "kleaver" new_line
-  #replace %p with path to source, 
-  regsub -all {%p} $new_line [file join $srcdir $subdir] new_line
-  #replace %s with filename
-  regsub -all {%s} $new_line $test new_line
-  #replace %t with temp filenames
-  regsub -all {%t} $new_line $tmpFile new_line
-  #replace %% with %
-  regsub -all {%%} $new_line % new_line
-  return $new_line
-}
-
-# This procedure runs the set of tests for the test_source_files array.
-proc RunLLVMTests { test_source_files } {
-  global srcroot objroot srcdir objdir subdir TEST_FEATURE_LIST target_triplet
-  set timeout 60
-
-  set path [file join $objdir $subdir]
-  
-  #Make Output Directory if it does not exist already
-  if { [file exists path] } {
-    cd $path
-  } else {
-    file mkdir $path
-    cd $path
-  }
-  
-  file mkdir Output
-  cd Output
-
-  foreach test $test_source_files {
-    #Should figure out best way to set the timeout
-    #set timeout 40
-    
-    set filename [file tail $test]
-    set outcome PASS
-    set tmpFile "$filename.tmp"
-
-    #set hasRunline bool to check if testcase has a runline
-    set numLines 0
-
-    # Open the test file and start reading lines
-    set testFileId [ open $test r]
-    set runline ""
-    set PRNUMS ""
-    foreach line [split [read $testFileId] \n] {
-
-      # if its the END. line then stop parsing (optimization for big files)
-      if {[regexp {END.[ *]$} $line match endofscript]} {
-        break
-
-      # if the line is continued, concatenate and continue the loop
-      } elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} {
-        set runline "$runline$oneline "
-
-      # if its a terminating RUN: line then do substitution on the whole line
-      # and then save the line.
-      } elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} {
-        set runline "$runline$oneline"
-        set runline [ substitute $runline $test $tmpFile ]
-        set lines($numLines) $runline
-        set numLines [expr $numLines + 1]
-        set runline ""
-
-      # if its an PR line, save the problem report number
-      } elseif {[regexp {PR([0-9]+)} $line match prnum]} {
-        if {$PRNUMS == ""} {
-          set PRNUMS "PR$prnum"
-        } else {
-          set PRNUMS "$PRNUMS,$prnum"
-        }
-      # if its an XFAIL line, see if we should be XFAILing or not.
-      } elseif {[regexp {XFAIL:[ *](.+)} $line match features]} {
-        set features
-
-        foreach feature [split $features ,] {
-          if { [regexp {\*} $feature match] } {
-              set outcome XFAIL
-          } elseif { [regexp $feature $target_triplet match] } {
-              set outcome XFAIL
-          } elseif { [regexp $feature $TEST_FEATURE_LIST match] } {
-              set outcome XFAIL
-          }
-        }
-      }
-    }
-    
-    # Done reading the script
-    close $testFileId
-    
-    
-    if { $numLines == 0 } {
-      fail "$test: \nDoes not have a RUN line\n"
-    } else {
-      set failed 0
-      for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
-        regsub ^.*RUN:(.*) $lines($i) \1 theLine
-        set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ]
-        if { $resultmsg != "" } {
-          if { $outcome == "XFAIL" } {
-            xfail "$resultmsg"
-          } else {
-            fail "$resultmsg"
-          }
-          set failed 1
-          break
-        }
-      }
-      if { $failed } {
-        continue
-      } else {
-        if { $PRNUMS != "" } {
-          set PRNUMS " for $PRNUMS"
-        }
-        if { $outcome == "XFAIL" } {
-          xpass "$test$PRNUMS"
-        } else {
-          pass "$test$PRNUMS"
-        }
-      }
-    }
-  }
-}
-
-# Check if klee was configured with POSIX runtime support.
-proc klee_supports_posix_runtime { } {
-    global ENABLE_POSIX_RUNTIME
-    if { $ENABLE_POSIX_RUNTIME == "1" } {
-        return 1
-    }
-    return 0
-}
-
-# Check if klee was configured with uclibc support.
-proc klee_supports_uclibc { } {
-    global ENABLE_UCLIBC
-    if { $ENABLE_UCLIBC == "1" } {
-        return 1
-    }
-    return 0
-}
diff --git a/test/regression/dg.exp b/test/regression/dg.exp
deleted file mode 100644
index 879685ca..00000000
--- a/test/regression/dg.exp
+++ /dev/null
@@ -1,3 +0,0 @@
-load_lib llvm.exp
-
-RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]