Skip to content

Commit 0839f02

Browse files
Arrange test suites
1 parent 9fa184e commit 0839f02

File tree

5 files changed

+43
-6
lines changed

5 files changed

+43
-6
lines changed

Project.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,22 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
1616
TerminalSystemMonitorCUDAExt = "CUDA"
1717

1818
[compat]
19+
Aqua = "0.8.9"
1920
CUDA = "5.5.2"
2021
Dates = "1"
22+
JET = "0.9.12"
2123
MLDataDevices = "1.5.3"
24+
ReTestItems = "1.29.0"
2225
Term = "2.0.6"
26+
Test = "1.11.0"
2327
UnicodePlots = "3.7.0"
24-
julia = "1"
28+
julia = "1.10"
29+
30+
[extras]
31+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
32+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
33+
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
34+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
35+
36+
[targets]
37+
test = ["Aqua", "JET", "ReTestItems", "Test"]

src/TerminalSystemMonitor.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ end
6666
function extract_number_and_unit(str::AbstractString)
6767
m = match(r"(\d+\.\d+)\s*(\w+)", str)
6868
if !isnothing(m)
69-
return parse(Float64, m.captures[1]), m.captures[2]
69+
return parse(Float64, m.captures[1]::SubString), m.captures[2]::SubString
7070
else
7171
return nothing, nothing
7272
end
@@ -84,10 +84,7 @@ function plot_cpu_utilization_rates()
8484

8585
chunks = collect.(collect(Iterators.partition((1:ncpus), 4)))
8686
for c in chunks
87-
push!(
88-
plts,
89-
barplot(xs[c], ys[c], maximum = 100, width = 15, height = length(c)),
90-
)
87+
push!(plts, barplot(xs[c], ys[c], maximum = 100, width = 15, height = length(c)))
9188
end
9289
return plts
9390
end
@@ -96,6 +93,9 @@ function plot_cpu_memory_utilization()
9693
memorytotal, memorytotal_unit =
9794
Sys.total_memory() |> Base.format_bytes |> extract_number_and_unit
9895
memoryfree, _ = Sys.free_memory() |> Base.format_bytes |> extract_number_and_unit
96+
if isnothing(memorytotal) || isnothing(memoryfree)
97+
return []
98+
end
9999
memoryusage = memorytotal - memoryfree
100100
memorytotal = round(memorytotal)
101101

test/aqua_tests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@testitem "Aqua" begin
2+
using Aqua
3+
using Test
4+
using TerminalSystemMonitor
5+
@testset "Aqua" begin
6+
Aqua.test_all(TerminalSystemMonitor)
7+
end
8+
end

test/jet_tests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#=@testitem "JET" begin
2+
using Test
3+
using JET
4+
using TerminalSystemMonitor
5+
6+
@testset "JET" begin
7+
if VERSION ≥ v"1.10"
8+
JET.test_package(TerminalSystemMonitor; target_defined_modules=true)
9+
end
10+
end
11+
end
12+
=#

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using ReTestItems
2+
using TerminalSystemMonitor
3+
4+
ReTestItems.runtests(TerminalSystemMonitor)

0 commit comments

Comments
 (0)