2019-08-24 11:15:40 +00:00
|
|
|
// Copyright © 2019 Ettore Di Giacinto <mudler@gentoo.org>
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
package gentoo_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
|
|
|
|
. "github.com/mudler/luet/pkg/tree/builder/gentoo"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("GentooBuilder", func() {
|
|
|
|
|
|
|
|
Context("Simple test", func() {
|
|
|
|
It("parses correctly deps", func() {
|
2019-11-01 11:41:31 +00:00
|
|
|
gb := NewGentooBuilder(&SimpleEbuildParser{}, 20)
|
2019-08-24 11:15:40 +00:00
|
|
|
tree, err := gb.Generate("../../../../tests/fixtures/overlay")
|
|
|
|
Expect(err).ToNot(HaveOccurred())
|
2019-10-30 16:52:57 +00:00
|
|
|
defer func() {
|
|
|
|
Expect(tree.GetPackageSet().Clean()).ToNot(HaveOccurred())
|
|
|
|
}()
|
|
|
|
|
2019-11-01 10:32:17 +00:00
|
|
|
Expect(len(tree.GetPackageSet().GetPackages())).To(Equal(10))
|
2019-08-24 11:15:40 +00:00
|
|
|
|
2019-10-28 16:12:29 +00:00
|
|
|
for _, pid := range tree.GetPackageSet().GetPackages() {
|
|
|
|
p, err := tree.GetPackageSet().GetPackage(pid)
|
|
|
|
Expect(err).ToNot(HaveOccurred())
|
2019-08-24 11:15:40 +00:00
|
|
|
Expect(p.GetName()).To(ContainSubstring("pinentry"))
|
2019-10-31 11:35:34 +00:00
|
|
|
// Expect(p.GetVersion()).To(ContainSubstring("1."))
|
2019-08-24 11:15:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|