forked from hwaf/hwaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_cernroot_dicts_test.go
106 lines (91 loc) · 2.6 KB
/
test_cernroot_dicts_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package main_test
import (
"io/ioutil"
"os"
"os/exec"
"testing"
)
func TestCernRootCint(t *testing.T) {
{
if err := exec.Command("which", "root-config").Run(); err != nil {
t.Skip("skipping test. (needs CERN-ROOT (missing root-config))")
}
if err := exec.Command("which", "rootcint").Run(); err != nil {
t.Skip("skipping test. (needs CERN-ROOT) (missing rootcint)")
}
}
workdir, err := ioutil.TempDir("", "hwaf-test-")
if err != nil {
t.Fatalf(err.Error())
}
defer os.RemoveAll(workdir)
err = os.Chdir(workdir)
if err != nil {
t.Fatalf(err.Error())
}
hwaf, err := newlogger("hwaf.log")
if err != nil {
t.Fatalf(err.Error())
}
defer hwaf.Close()
for _, cmd := range [][]string{
{"hwaf", "init", "-v=1", "."},
{"hwaf", "setup", "-v=1"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-pkg-settings", "pkg-settings"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-rootcint-pkg1", "pkg1"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-rootcint-pkg2", "pkg2"},
{"hwaf", "configure"},
{"hwaf"},
{"hwaf", "run", "root", "-l", "-b", "src/pkg2/share/run.C"},
} {
err := hwaf.Run(cmd[0], cmd[1:]...)
if err != nil {
hwaf.Display()
t.Fatalf("cmd %v failed: %v", cmd, err)
}
}
}
func TestCernRootReflex(t *testing.T) {
{
if err := exec.Command("which", "root-config").Run(); err != nil {
t.Skip("skipping test. (needs CERN-ROOT (missing root-config))")
}
if err := exec.Command("which", "genreflex").Run(); err != nil {
t.Skip("skipping test. (needs CERN-ROOT) (missing genreflex)")
}
if err := exec.Command("which", "gccxml").Run(); err != nil {
t.Skip("skipping test. (needs CERN-ROOT) (missing gccxml)")
}
}
workdir, err := ioutil.TempDir("", "hwaf-test-")
if err != nil {
t.Fatalf(err.Error())
}
defer os.RemoveAll(workdir)
err = os.Chdir(workdir)
if err != nil {
t.Fatalf(err.Error())
}
hwaf, err := newlogger("hwaf.log")
if err != nil {
t.Fatalf(err.Error())
}
defer hwaf.Close()
for _, cmd := range [][]string{
{"hwaf", "init", "-v=1", "."},
{"hwaf", "setup", "-v=1"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-pkg-settings", "pkg-settings"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-rootreflex-pkg1", "pkg1"},
{"hwaf", "pkg", "co", "-v=1", "git://github.com/hwaf/hwaf-tests-rootreflex-pkg2", "pkg2"},
{"hwaf", "configure"},
{"hwaf"},
{"hwaf", "run", "root", "-l", "-b", "src/pkg2/share/run.C"},
} {
err := hwaf.Run(cmd[0], cmd[1:]...)
if err != nil {
hwaf.Display()
t.Fatalf("cmd %v failed: %v", cmd, err)
}
}
}
// EOF