-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
195 lines (168 loc) · 5.03 KB
/
Justfile
File metadata and controls
195 lines (168 loc) · 5.03 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# -*- Justfile -*-
coverage_file := "coverage.out"
# List the available justfile recipes.
[group('general')]
@default:
just --list --unsorted
# List the lines of code in the project.
[group('general')]
loc:
scc --remap-unknown "-*- Justfile -*-":"justfile"
# View documentation in web browser using pkgsite.
[group('general')]
docs:
pkgsite -open .
# Fix, format, and vet Go code. Runs before tests.
[group('test')]
check:
go fix ./...
go fmt ./...
go vet ./...
# Lint using golangci-lint
[group('test')]
lint:
golangci-lint run --config .golangci.yaml
# Run the unit tests.
[group('test')]
unit *FLAGS: check
go test ./... -cover -vet=off -race {{FLAGS}} -short
# Run the integration tests.
[group('test')]
int *FLAGS: check
go test ./... -cover -vet=off -race {{FLAGS}} -run Integration
# Run the end-to-end tests.
[group('test')]
e2e *FLAGS: check
go test ./... -cover -vet=off -race {{FLAGS}} -run E2E
# HTML report for unit (default), int, e2e, or all tests.
[group('test')]
cover test='unit': check
go test ./... -vet=off -coverprofile={{coverage_file}} \
{{ if test == 'all' { '' } \
else if test == 'int' { '-run Integration' } \
else if test == 'e2e' { '-run E2E' } \
else { '-short' } }}
go tool cover -html={{coverage_file}}
# List the outdated direct dependencies (slow to run).
[group('dependencies')]
outdated:
# (requires https://github.com/psampaz/go-mod-outdated).
go list -u -m -json all | go-mod-outdated -update -direct
# Update the given module to the latest version.
[group('dependencies')]
update mod:
go get -u {{mod}}
go mod tidy
# Update all modules.
[group('dependencies')]
updateall:
go get -u ./...
go mod tidy
# Run go mod tidy and verify.
[group('dependencies')]
tidy:
go mod tidy
# ASRL SRS DS345 function generator.
[group('examples')]
ds345 port:
#!/usr/bin/env bash
echo '# IVI ASRL SRS DS345 Example Application'
cd {{justfile_directory()}}/cmd/asrl/ds345
env go build -o ds345
./ds345 -port={{port}}
# LXI Keysight 33512B function generator.
[group('examples')]
k33512lxi ip:
#!/usr/bin/env bash
echo '# IVI LXI Keysight 33512B Example Application'
cd {{justfile_directory()}}/cmd/lxi/key33512
env go build -o key33512
./key33512 -ip={{ip}}
# LXI Keysight 33220A function generator.
[group('examples')]
k33220lxi ip:
#!/usr/bin/env bash
echo '# IVI LXI Keysight 33220A Example Application'
cd {{justfile_directory()}}/cmd/lxi/key33220
env go build -o key33220
./key33220 -ip={{ip}}
# USBTMC Keysight 33220A function generator.
[group('examples')]
k33220usb sn:
#!/usr/bin/env bash
echo '# IVI USBTMC Keysight 33220A Example Application'
cd {{justfile_directory()}}/cmd/usbtmc/key33220
env go build -o key33220
./key33220 -sn={{sn}}
# VISA USBTMC Keysight 33220A function generator.
[group('examples')]
k33220visa:
#!/usr/bin/env bash
echo '# IVI VISA USBTMC Keysight 33220A Example Application'
cd {{justfile_directory()}}/cmd/visa/usbtmc/key33220
env go build -o key33220
./key33220 -visa="USB0::2391::1031::MY44035849::INSTR"
# Prologix VCP GPIB Keysight 33220A function generator.
[group('examples')]
k33220gpib port:
#!/usr/bin/env bash
echo '# IVI Prologix VCP GPIB Keysight 33220A Example Application'
cd {{justfile_directory()}}/cmd/prologix/vcp/key33220
env go build -o key33220
./key33220 -port={{port}}
# LXI Keysight 34461A DMM.
[group('examples')]
k34461lxi ip:
#!/usr/bin/env bash
echo '# IVI LXI Keysight 34461A Example Application'
cd {{justfile_directory()}}/cmd/lxi/key34461a
env go build -o key34461a
./key34461a -ip={{ip}}
# Prologix VCP GPIB Keysight E3631A power supply.
[group('examples')]
k3631gpib port:
#!/usr/bin/env bash
echo '# IVI Prologix VCP GPIB Keysight E3631A Example Application'
cd {{justfile_directory()}}/cmd/prologix/vcp/e3631a
env go build -o e3631a
./e3631a -port={{port}}
# ASRL Keysight E3631A power supply.
[group('examples')]
k3631asrl port:
#!/usr/bin/env bash
echo '# IVI ASRL Keysight E3631A Example Application'
cd {{justfile_directory()}}/cmd/asrl/e3631a
env go build -o e3631a
./e3631a -port={{port}}
# LXI Keysight InfiniiVision MSO-X 3024A.
[group('examples')]
k3024lxi ip:
#!/usr/bin/env bash
echo '# IVI LXI Keysight InfiniiVision MSO-X 3024A Example Application'
cd {{justfile_directory()}}/cmd/lxi/key3024
env go build -o key3024
./key3024 -ip={{ip}}
# LXI Kikusui PMX DC power supply.
[group('examples')]
pmxlxi ip:
#!/usr/bin/env bash
echo '# IVI LXI Kikusui PMX Example Application'
cd {{justfile_directory()}}/cmd/lxi/pmx
env go build -o pmx
./pmx -ip={{ip}}
# Prologix VCP GPIB Fluke 45 DMM.
[group('examples')]
f45gpib port:
#!/usr/bin/env bash
echo '# IVI Prologix VCP GPIB Fluke 45 Example Application'
cd {{justfile_directory()}}/cmd/prologix/vcp/fluke45
env go build -o fluke45
./fluke45 -port={{port}}
# USBTMC Keysight U2751A switch matrix.
[group('examples')]
ku2751usb:
#!/usr/bin/env bash
echo '# IVI USBTMC Keysight U2751A Example Application'
cd {{justfile_directory()}}/cmd/usbtmc/keyu2751a
env go build -o keyu2751a
./keyu2751a