Skip to content

Commit b0bc0b0

Browse files
committed
Added test for cores metrics
1 parent a93c2f4 commit b0bc0b0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

cores_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* Copyright 2017 Victor Penso, Matteo Dessalvi
2+
3+
This program is free software: you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation, either version 3 of the License, or
6+
(at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
15+
16+
package main
17+
18+
import (
19+
"testing"
20+
"os"
21+
"io/ioutil"
22+
)
23+
24+
func TestCoresMetrics(t *testing.T) {
25+
// Read the input data from a file
26+
file, err := os.Open("test_data/sinfo_cores.txt")
27+
if err != nil { t.Fatalf("Can not open test data: %v", err) }
28+
data, err := ioutil.ReadAll(file)
29+
t.Logf("%+v", ParseCoresMetrics(data))
30+
}
31+
32+
func TestCoresGetMetrics(t *testing.T) {
33+
t.Logf("%+v", CoresGetMetrics())
34+
}

0 commit comments

Comments
 (0)