File tree 5 files changed +13
-15
lines changed
5 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,4 @@ format: earlyoom
81
81
clang-format -i * .h * .c
82
82
83
83
test : earlyoom
84
- # Go does not notice when the C code changes, so we have to
85
- # use `go clean` and `go test -a`.
86
- # See https://github.com/golang/go/issues/24355 .
87
- cd tests && go clean -cache -testcache . && go test -a -v
84
+ go test -v
Original file line number Diff line number Diff line change 1
- package tests
1
+ package earlyoom_testsuite
2
2
3
3
import (
4
4
"fmt"
5
5
"os"
6
6
)
7
7
8
- // #cgo CFLAGS: -std=gnu99
9
- // #include "../globals.c"
10
- // #include "../sanitize.c"
11
- // #include "../msg.c"
12
- // #include "../meminfo.c"
8
+ // #cgo CFLAGS: -std=gnu99 -DCGO
9
+ // #include "meminfo.h"
10
+ // #include "kill.h"
11
+ // #include "msg.h"
13
12
import "C"
14
13
15
14
func sanitize (s string ) string {
Original file line number Diff line number Diff line change 1
- package tests
1
+ package earlyoom_testsuite
2
2
3
3
import (
4
4
"fmt"
@@ -154,7 +154,7 @@ func TestCli(t *testing.T) {
154
154
}
155
155
156
156
func TestRss (t * testing.T ) {
157
- cmd := exec .Command ("../earlyoom" )
157
+ cmd := exec .Command (earlyoomBinary )
158
158
err := cmd .Start ()
159
159
if err != nil {
160
160
t .Fatal (err )
Original file line number Diff line number Diff line change 1
- package tests
1
+ package earlyoom_testsuite
2
2
3
3
import (
4
4
"bytes"
@@ -16,10 +16,12 @@ type exitVals struct {
16
16
stderr string
17
17
}
18
18
19
+ const earlyoomBinary = "./earlyoom"
20
+
19
21
// runEarlyoom runs earlyoom with a timeout
20
22
func runEarlyoom (t * testing.T , args ... string ) exitVals {
21
23
var stdoutBuf , stderrBuf bytes.Buffer
22
- cmd := exec .Command ("../earlyoom" , args ... )
24
+ cmd := exec .Command (earlyoomBinary , args ... )
23
25
cmd .Stdout = & stdoutBuf
24
26
cmd .Stderr = & stderrBuf
25
27
Original file line number Diff line number Diff line change 1
- package tests
1
+ package earlyoom_testsuite
2
2
3
3
import (
4
4
"os"
You can’t perform that action at this time.
0 commit comments