Merge pull request #819 from Jguer/8.2

Fix tests broken in master
This commit is contained in:
J Guerreiro 2018-12-03 14:06:10 +00:00 committed by GitHub
commit 7644a92c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 68 deletions

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}

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"

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 {

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()

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)
}

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)
}