Commits

kylelemons committed 73789c1

Updated to lastest version of go

Comments (0)

Files changed (7)

 cd testsuite
 
 ##### Make sure the test suite builds with changes (TODO: CGO)
-gofr -c 2>&1 | wc -l | grep '^0$' >/dev/null
+gofr -c 2>&1 | wc -l | egrep '^[ \t]*0$' >/dev/null
 
 ##### -C        --clean-only     Same as --clean, except exits after the objects are removed
 gofr --clean-only 2>&1 && [[ ! -d _obj ]]
 gofr --clean-only && gofr --pretend >/dev/null && [[ ! -d _obj ]]
 
 ##### -v        --verbose        Show commands as they are executed
-gofr --verbose 2>&1 | grep "8g" >/dev/null
+gofr --verbose 2>&1 | egrep "[4568]g" >/dev/null
 gofr --clean-only
 
 ##### -V        --very-verbose       Show very verbose debugging information
 
 # Massive install tests
 gofr -vcik gofr.test.com --prefix=/tmp/gofr --bin-prefix=/tmp/gofr | grep "^cp" >/dev/null
-find /tmp/gofr -executable -and -not -type d -and -not -name "*.so" -exec {} \; | grep PASS | wc -l | grep "^8$" >/dev/null
+find /tmp/gofr -executable -and -not -type d -and -not -name "*.so" -exec {} \; | grep PASS | wc -l | grep "^[ \t]*8$" >/dev/null
 rm -rf /tmp/gofr
 
 # Test --test
-gofr -t | grep "^PASS$" | wc -l | grep "^2$" >/dev/null
+gofr -t | grep "^PASS$" | wc -l | grep "^[ \t]*2$" >/dev/null
 
 ##### -l lib    --libs=lib       CGO Libraries (can specify multiple times)
 ##### -f        --format         Format go source files if they do not adhere to gofmt rules
 set -ev
 ### Install dependencies ###
 goinstall -u github.com/droundy/goopt
+goinstall -u goconf.googlecode.com/hg
 
 ### Build the library ###
-cd pkg && make install && cd -
+cd pkg
+make install
+cd -
 
 ### Build the command ###
-cd cmd && make install && cd -
+cd cmd
+make install
+cd -
 
 ### Run the test suite ###
 bash .test
 	finder := newGoFileFinder(ignore)
 	path.Walk(".", finder, nil)
 
+	// Create FileSet
+	fset := token.NewFileSet()
 	// Parse the files
 	for _, file := range finder.files.Copy() {
 		// Parse all files
-		tree, err := parser.ParseFile(file, nil, parser.ImportsOnly|parser.ParseComments)
+		tree, err := parser.ParseFile(fset, file, nil, parser.ImportsOnly|parser.ParseComments)
 		check_err(err, "Could not parse "+file)
 
 		// Get dir
 		}
 		if strings.HasPrefix(line, "TEST") {
 			for _, testName := range testlist.Copy() {
-				out.Write([]byte(fmt.Sprintf("\t\ttesting.Test{\"%s\", %s},\n", testName, pkg+"."+testName)))
+				out.Write([]byte(fmt.Sprintf("\t\ttesting.InternalTest{\"%s\", %s},\n", testName, pkg+"."+testName)))
 			}
 		} else if strings.HasPrefix(line, "BENCH") {
 			for _, benchName := range benchlist.Copy() {
-				out.Write([]byte(fmt.Sprintf("\t\ttesting.Benchmark{\"%s\", %s},\n", benchName, pkg+"."+benchName)))
+				out.Write([]byte(fmt.Sprintf("\t\ttesting.InternalBenchmark{\"%s\", %s},\n", benchName, pkg+"."+benchName)))
 			}
 		} else if strings.HasPrefix(line, "PACK") {
 			out.Write([]byte(fmt.Sprintf("\t\"%s\"\n", pkg)))
 var testMainTemplate = `package main
 
 import (
+	"os"
 	"testing"
 ///PACKAGE
 )
 
+func matchString(pat, str string) (matched bool, err os.Error) {
+	matched = true
+	err = nil
+	return
+}
+
 func main() {
-	testing.Main([]testing.Test{
+	testing.Main(matchString, []testing.InternalTest{
 ///TESTS
 	})
-	testing.RunBenchmarks([]testing.Benchmark{
+	testing.RunBenchmarks(matchString, []testing.InternalBenchmark{
 ///BENCHMARKS
 	})
 }

testsuite/cgonested/sub/ctpkg.c

 int CountSpaces(char *s) {
   int ret = 0;
   if (s && *s) do {
-    if isspace(*s) ret++;
+    if (isspace(*s)) ret++;
   } while (*++s);
   return ret;
 }

testsuite/cgotpkg/ctpkg.c

 int CountSpaces(char *s) {
   int ret = 0;
   if (s && *s) do {
-    if isspace(*s) ret++;
+    if (isspace(*s)) ret++;
   } while (*++s);
   return ret;
 }

testsuite/cgowithtest/ctpkg.c

 int CountSpaces(char *s) {
   int ret = 0;
   if (s && *s) do {
-    if isspace(*s) ret++;
+    if (isspace(*s)) ret++;
   } while (*++s);
   return ret;
 }