Fix tests and prepare for release

This commit is contained in:
Jguer committed 2018-12-01 15:03:46 +00:00
1 parent 91cf1e27a1
commit 5bcadc58ac
6 files changed
+6 -68

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ PREFIX := /usr
DESTDIR :=
MAJORVERSION := 8
MINORVERSION ?= $(shell git rev-list --count master)
MINORVERSION ?= 2
PATCHVERSION := 0
VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION}
+1 -1
View File
@@ -78,7 +78,7 @@ type Configuration struct {
UseAsk bool `json:"useask"`
}
var version = "8.1173"
var version = "8.2.0"
// configFileName holds the name of the config file.
const configFileName string = "config.json"
+2 -1
View File
@@ -14,7 +14,8 @@ func expect(t *testing.T, field string, a interface{}, b interface{}, err error)
}
func TestConfig(t *testing.T) {
config.PacmanConf = "testdata/pacman.conf"
config = &Configuration{}
config.PacmanConf = "./testdata/pacman.conf"
err := initAlpm()
if err != nil {
+2 -2
View File
@@ -434,9 +434,9 @@ nextpkg:
if len(incompatible) > 0 {
fmt.Println()
fmt.Print(bold(yellow(arrow))+" The following packages are not compatible with your architecture:")
fmt.Print(bold(yellow(arrow)) + " The following packages are not compatible with your architecture:")
for pkg := range incompatible {
fmt.Print(" "+cyan(basesMap[pkg].String()))
fmt.Print(" " + cyan(basesMap[pkg].String()))
}
fmt.Println()
-36
View File
@@ -1,36 +0,0 @@
package main
import (
"os"
"testing"
)
func benchmarkPrintSearch(search string, b *testing.B) {
old := os.Stdout
_, w, _ := os.Pipe()
os.Stdout = w
for n := 0; n < b.N; n++ {
res, _ := queryRepo(append([]string{}, search))
res.printSearch()
}
os.Stdout = old
}
func BenchmarkPrintSearchSimpleTopDown(b *testing.B) {
config.SortMode = TopDown
benchmarkPrintSearch("chromium", b)
}
func BenchmarkPrintSearchComplexTopDown(b *testing.B) {
config.SortMode = TopDown
benchmarkPrintSearch("linux", b)
}
func BenchmarkPrintSearchSimpleBottomUp(b *testing.B) {
config.SortMode = BottomUp
benchmarkPrintSearch("chromium", b)
}
func BenchmarkPrintSearchComplexBottomUp(b *testing.B) {
config.SortMode = BottomUp
benchmarkPrintSearch("linux", b)
}
-27
View File
@@ -1,27 +0,0 @@
package main
import "testing"
func benchmarkSearch(search string, b *testing.B) {
for n := 0; n < b.N; n++ {
queryRepo(append([]string{}, search))
}
}
func BenchmarkSearchSimpleTopDown(b *testing.B) {
config.SortMode = TopDown
benchmarkSearch("chromium", b)
}
func BenchmarkSearchSimpleBottomUp(b *testing.B) {
config.SortMode = BottomUp
benchmarkSearch("chromium", b)
}
func BenchmarkSearchComplexTopDown(b *testing.B) {
config.SortMode = TopDown
benchmarkSearch("linux", b)
}
func BenchmarkSearchComplexBottomUp(b *testing.B) {
config.SortMode = BottomUp
benchmarkSearch("linux", b)
}