Skip to content

Commit 6c5c2ef

Browse files
committed
test(trycmd): autogenerate testing dir
Signed-off-by: Christina Sørensen <[email protected]>
1 parent f23ff86 commit 6c5c2ef

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ stage
2828
# VHS testing stuff
2929
out.gif
3030
tests/tmp
31+
32+
## Dynamically generated
33+
tests/test_dir

Justfile

+43
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,49 @@ alias c := cross
175175
# Integration testing #
176176
#---------------------#
177177

178+
alias gen := gen_test_dir
179+
180+
test_dir := "tests/test_dir"
181+
182+
gen_test_dir:
183+
#!/usr/bin/env bash
184+
rm {{test_dir}} -r;
185+
mkdir -p {{test_dir}}
186+
cd {{test_dir}};
187+
188+
# BEGIN grid
189+
mkdir -p grid
190+
cd grid
191+
192+
mkdir $(seq -w 001 1000);
193+
seq 0001 1000 | split -l 1 -a 3 -d - file_
194+
195+
# Set time to unix epoch
196+
touch --date=@0 *;
197+
198+
cd ..
199+
200+
# END grid
201+
202+
# BEGIN git
203+
204+
mkdir -p git
205+
cd git
206+
207+
mkdir $(seq -w 001 10);
208+
for f in ./*
209+
do
210+
cd $f
211+
git init
212+
seq 01 10 | split -l 1 -a 3 -d - file_
213+
cd ..
214+
done
215+
216+
cd ..
217+
218+
# END git
219+
eza -l --grid;
220+
178221
# Runs integration tests in nix sandbox
179222
#
180223
# Required nix, likely won't work on windows.

0 commit comments

Comments
 (0)