From 1e784703f792092a49d8679052e1a7bf8f2c7287 Mon Sep 17 00:00:00 2001 From: yuki Date: Sun, 5 May 2024 22:47:52 +0800 Subject: [PATCH 1/7] Added test file for Github CI. --- .gitignore | 1 - test.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 test.sh diff --git a/.gitignore b/.gitignore index 1faee90..a93a910 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /bin catnip *.exe -*.sh *.gz diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..a70973b --- /dev/null +++ b/test.sh @@ -0,0 +1,14 @@ +# alias for config +alias catnip='./bin/catnip -c config/config.toml -a config/distros.toml' +# test help +catnip -h +# test distroid +catnip -d arch +# test margin +catnip -m 1,2,3 +# test layout +catnip -l ArtOnTop +# test figletlogos mode +catnip -fe on +# test figletlogos margin +catnip -fe on -fm 1,2,3 From a497d9c40c2cdc7b543a60bb94b27221b863193b Mon Sep 17 00:00:00 2001 From: yuki Date: Sun, 5 May 2024 22:49:01 +0800 Subject: [PATCH 2/7] Update build-test.yml Added test for Catnip functionality (does not include grep and figlet font yet.) --- .github/workflows/build-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d5cd426..2016ea9 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,3 +19,7 @@ jobs: nim-version: '2.x' - name: 'Build Catnip' run: nim release + - name: 'Install Figlet' + run: apt-get install figlet + - name: 'Test Catnip' + run: ./test.sh From 236ca649287aca5d23da7e6d5ddcbeb13f22c0b9 Mon Sep 17 00:00:00 2001 From: yuki Date: Sun, 5 May 2024 22:50:47 +0800 Subject: [PATCH 3/7] Update build-test.yml Forgot to add sudo to install packages with `apt-get`. --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2016ea9..02774a5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -20,6 +20,6 @@ jobs: - name: 'Build Catnip' run: nim release - name: 'Install Figlet' - run: apt-get install figlet + run: sudo apt-get install figlet - name: 'Test Catnip' run: ./test.sh From dc17b9e9a8c34313b0cc26596143b69344117a55 Mon Sep 17 00:00:00 2001 From: yuki Date: Sun, 5 May 2024 22:54:29 +0800 Subject: [PATCH 4/7] Update test.sh Removed alias. --- test.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test.sh b/test.sh index a70973b..5b15aec 100755 --- a/test.sh +++ b/test.sh @@ -1,14 +1,12 @@ -# alias for config -alias catnip='./bin/catnip -c config/config.toml -a config/distros.toml' # test help -catnip -h +./bin/catnip -c config/config.toml -a config/distros.toml -h # test distroid -catnip -d arch +./bin/catnip -c config/config.toml -a config/distros.toml -d arch # test margin -catnip -m 1,2,3 +./bin/catnip -c config/config.toml -a config/distros.toml -m 1,2,3 # test layout -catnip -l ArtOnTop +./bin/catnip -c config/config.toml -a config/distros.toml -l ArtOnTop # test figletlogos mode -catnip -fe on +./bin/catnip -c config/config.toml -a config/distros.toml -fe on # test figletlogos margin -catnip -fe on -fm 1,2,3 +./bin/catnip -c config/config.toml -a config/distros.toml -fe on -fm 1,2,3 From 49cc141836eb5377a8e9b6fa0b832de0784ac288 Mon Sep 17 00:00:00 2001 From: yuki Date: Mon, 6 May 2024 10:14:36 +0800 Subject: [PATCH 5/7] Added grep and figlet font tests in test.sh, in the test/ directory. --- test.sh | 12 - test/basic.flf | 819 +++++++++++++++++++++++++++++++++++++++++++++++++ test/test.sh | 16 + 3 files changed, 835 insertions(+), 12 deletions(-) delete mode 100755 test.sh create mode 100644 test/basic.flf create mode 100755 test/test.sh diff --git a/test.sh b/test.sh deleted file mode 100755 index 5b15aec..0000000 --- a/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -# test help -./bin/catnip -c config/config.toml -a config/distros.toml -h -# test distroid -./bin/catnip -c config/config.toml -a config/distros.toml -d arch -# test margin -./bin/catnip -c config/config.toml -a config/distros.toml -m 1,2,3 -# test layout -./bin/catnip -c config/config.toml -a config/distros.toml -l ArtOnTop -# test figletlogos mode -./bin/catnip -c config/config.toml -a config/distros.toml -fe on -# test figletlogos margin -./bin/catnip -c config/config.toml -a config/distros.toml -fe on -fm 1,2,3 diff --git a/test/basic.flf b/test/basic.flf new file mode 100644 index 0000000..b3d72a9 --- /dev/null +++ b/test/basic.flf @@ -0,0 +1,819 @@ +flf2a$ 8 8 17 -1 2 +basic.flf by Craig O'Flaherty +August 17, 1994 +$$@ +$$@ +$$@ +$$@ +$$@ +$$@ +$$@ +$$@@ +db$@ +88$@ +YP$@ + $@ +db$@ +YP$@ + $@ + $@@ +.o. .o.$@ +`8' `8'$@ + $@ + $@ + $@ + $@ + $@ + $@@ + $@ + db db $@ +C88888D$@ + 88 88 $@ +C88888D$@ + YP YP $@ + $@ + $@@ + A $@ +.d8888.$@ +88'8 YP$@ +`8b8. $@ + `V8b.$@ +db 8 8D$@ +`8888Y'$@ + V $@@ +db dD$@ +YP d8'$@ + d8' $@ + d8' $@ + d8' db$@ +d8' YP$@ + $@ + $@@ +.d888b. $@ +8P 8D $@ +`Vb d8' $@ + d88C dD$@ +C8' d8D $@ +`888P Yb$@ + $@ + $@@ +Cb$@ +`D$@ + '$@ + $@ + $@ + $@ + $@ + $@@ + dD$@ + d8' $@ + d8 $@ +C88 $@ + V8 $@ + V8. $@ + VD$@ + $@@ +Cb $@ + `8b $@ + 8b $@ + 88D$@ + 8P $@ + .8P $@ +CP $@ + $@@ + $@ +8. A .8$@ +`8.8.8'$@ + 888 $@ +.d'8`b.$@ +8' V `8$@ + $@ + $@@ + $@ + db $@ + 88 $@ +C8888D$@ + 88 $@ + VP $@ + $@ + $@@ + $@ + $@ + $@ + $@ +db$@ +V8$@ + P$@ + $@@ + $@ + $@ + $@ +C8888D$@ + $@ + $@ + $@ + $@@ + $@ + $@ + $@ + $@ +db$@ +VP$@ + $@ + $@@ + dD$@ + d8'$@ + d8' $@ + d8' $@ + d8' $@ +C8' $@ + $@ + $@@ + .d88b. $@ +.8P 88.$@ +88 d'88$@ +88 d' 88$@ +`88 d8'$@ + `Y88P' $@ + $@ + $@@ + db$@ +o88$@ + 88$@ + 88$@ + 88$@ + VP$@ + $@ + $@@ +.d888b.$@ +VP `8D$@ + odD'$@ + .88' $@ +j88. $@ +888888D$@ + $@ + $@@ +d8888b.$@ +VP `8D$@ + oooY'$@ + ~~~b.$@ +db 8D$@ +Y8888P'$@ + $@ + $@@ + j88D $@ + j8~88 $@ +j8' 88 $@ +V88888D$@ + 88 $@ + VP $@ + $@ + $@@ + ooooo$@ + 8P~~~~$@ +dP $@ +V8888b.$@ + `8D$@ +88oobY'$@ + $@ + $@@ + dD $@ + d8' $@ + d8' $@ +d8888b.$@ +88' `8D$@ +`8888P $@ + $@ + $@@ +d88888D$@ +VP d8'$@ + d8' $@ + d8' $@ + d8' $@ +d8' $@ + $@ + $@@ +.d888b.$@ +88 8D$@ +`VoooY'$@ +.d~~~b.$@ +88 8D$@ +`Y888P'$@ + $@ + $@@ +.d888b.$@ +88' `8D$@ +`V8o88'$@ + d8' $@ + d8' $@ + d8' $@ + $@ + $@@ + $@ +db$@ +VP$@ + $@ +db$@ +VP$@ + $@ + $@@ + $@ +db$@ +VP$@ + $@ +db$@ +V8$@ + P$@ + $@@ + $@ + .dP$@ + .d8 $@ +,P $@ +`b $@ + `Vb $@ + `Vb$@ + $@@ + $@ +C8888D$@ + $@ +C8888D$@ + $@ + $@ + $@ + $@@ + $@ +Vb $@ + `Vb $@ + `V.$@ + .d'$@ + .dP $@ +dP $@ + $@@ +.d888b.$@ +VP `8D$@ + odD'$@ + 8P' $@ + oo $@ + VP $@ + $@ + $@@ + .o888b.$@ +d8' Y8$@ +8P db dP$@ +8b V8o8P$@ +Y8. d$@ + `Y888P'$@ + $@ + $@@ + .d8b. $@ +d8' `8b$@ +88ooo88$@ +88~~~88$@ +88 88$@ +YP YP$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oooY'$@ +88~~~b.$@ +88 8D$@ +Y8888P'$@ + $@ + $@@ + .o88b.$@ +d8P Y8$@ +8P $@ +8b $@ +Y8b d8$@ + `Y88P'$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88 88$@ +88 88$@ +88 .8D$@ +Y8888D'$@ + $@ + $@@ +d88888b$@ +88' $@ +88ooooo$@ +88~~~~~$@ +88. $@ +Y88888P$@ + $@ + $@@ +d88888b$@ +88' $@ +88ooo $@ +88~~~ $@ +88 $@ +YP $@ + $@ + $@@ + d888b $@ +88' Y8b$@ +88 $@ +88 ooo$@ +88. ~8~$@ + Y888P $@ + $@ + $@@ +db db$@ +88 88$@ +88ooo88$@ +88~~~88$@ +88 88$@ +YP YP$@ + $@ + $@@ +d888888b$@ + `88' $@ + 88 $@ + 88 $@ + .88. $@ +Y888888P$@ + $@ + $@@ + d88b$@ + `8P'$@ + 88 $@ + 88 $@ +db. 88 $@ +Y8888P $@ + $@ + $@@ +db dD$@ +88 ,8P'$@ +88,8P $@ +88`8b $@ +88 `88.$@ +YP YD$@ + $@ + $@@ +db $@ +88 $@ +88 $@ +88 $@ +88booo.$@ +Y88888P$@ + $@ + $@@ +.88b d88.$@ +88'YbdP`88$@ +88 88 88$@ +88 88 88$@ +88 88 88$@ +YP YP YP$@ + $@ + $@@ +d8b db$@ +888o 88$@ +88V8o 88$@ +88 V8o88$@ +88 V888$@ +VP V8P$@ + $@ + $@@ + .d88b. $@ +.8P Y8.$@ +88 88$@ +88 88$@ +`8b d8'$@ + `Y88P' $@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oodD'$@ +88~~~ $@ +88 $@ +88 $@ + $@ + $@@ + .d88b. $@ +.8P Y8.$@ +88 88$@ +88 88$@ +`8P d8'$@ + `Y88'Y8$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oobY'$@ +88`8b $@ +88 `88.$@ +88 YD$@ + $@ + $@@ +.d8888.$@ +88' YP$@ +`8bo. $@ + `Y8b.$@ +db 8D$@ +`8888Y'$@ + $@ + $@@ +d888888b$@ +`~~88~~'$@ + 88 $@ + 88 $@ + 88 $@ + YP $@ + $@ + $@@ +db db$@ +88 88$@ +88 88$@ +88 88$@ +88b d88$@ +~Y8888P'$@ + $@ + $@@ +db db$@ +88 88$@ +Y8 8P$@ +`8b d8'$@ + `8bd8' $@ + YP $@ + $@ + $@@ +db d8b db$@ +88 I8I 88$@ +88 I8I 88$@ +Y8 I8I 88$@ +`8b d8'8b d8'$@ + `8b8' `8d8' $@ + $@ + $@@ +db db$@ +`8b d8'$@ + `8bd8' $@ + .dPYb. $@ +.8P Y8.$@ +YP YP$@ + $@ + $@@ +db db$@ +`8b d8'$@ + `8bd8' $@ + 88 $@ + 88 $@ + YP $@ + $@ + $@@ +d88888D$@ +YP d8'$@ + d8' $@ + d8' $@ + d8' db$@ +d88888P$@ + $@ + $@@ +d88D$@ +88 $@ +88 $@ +88 $@ +88 $@ +L88D$@ + $@ + $@@ +Cb $@ +`8b $@ + `8b $@ + `8b $@ + `8b $@ + `8D$@ + $@ + $@@ +C88D$@ + 88$@ + 88$@ + 88$@ + 88$@ +C888$@ + $@ + $@@ + db $@ + .dPVb. $@ +dP' `Vb$@ + $@ + $@ + $@ + $@ + $@@ + $@ + $@ + $@ + $@ + $@ +C88888D$@ + $@ + $@@ +dD$@ +C'$@ + `$@ + $@ + $@ + $@ + $@ + $@@ + .d8b. $@ +d8' `8b$@ +88ooo88$@ +88~~~88$@ +88 88$@ +YP YP$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oooY'$@ +88~~~b.$@ +88 8D$@ +Y8888P'$@ + $@ + $@@ + .o88b.$@ +d8P Y8$@ +8P $@ +8b $@ +Y8b d8$@ + `Y88P'$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88 88$@ +88 88$@ +88 .8D$@ +Y8888D'$@ + $@ + $@@ +d88888b$@ +88' $@ +88ooooo$@ +88~~~~~$@ +88. $@ +Y88888P$@ + $@ + $@@ +d88888b$@ +88' $@ +88ooo $@ +88~~~ $@ +88 $@ +YP $@ + $@ + $@@ + d888b $@ +88' Y8b$@ +88 $@ +88 ooo$@ +88. ~8~$@ + Y888P $@ + $@ + $@@ +db db$@ +88 88$@ +88ooo88$@ +88~~~88$@ +88 88$@ +YP YP$@ + $@ + $@@ +d888888b$@ + `88' $@ + 88 $@ + 88 $@ + .88. $@ +Y888888P$@ + $@ + $@@ + d88b$@ + `8P'$@ + 88 $@ + 88 $@ +db. 88 $@ +Y8888P $@ + $@ + $@@ +db dD$@ +88 ,8P'$@ +88,8P $@ +88`8b $@ +88 `88.$@ +YP YD$@ + $@ + $@@ +db $@ +88 $@ +88 $@ +88 $@ +88booo.$@ +Y88888P$@ + $@ + $@@ +.88b d88.$@ +88'YbdP`88$@ +88 88 88$@ +88 88 88$@ +88 88 88$@ +YP YP YP$@ + $@ + $@@ +d8b db$@ +888o 88$@ +88V8o 88$@ +88 V8o88$@ +88 V888$@ +VP V8P$@ + $@ + $@@ + .d88b. $@ +.8P Y8.$@ +88 88$@ +88 88$@ +`8b d8'$@ + `Y88P' $@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oodD'$@ +88~~~ $@ +88 $@ +88 $@ + $@ + $@@ + .d88b. $@ +.8P Y8.$@ +88 88$@ +88 88$@ +`8P d8'$@ + `Y88'Y8$@ + $@ + $@@ +d8888b.$@ +88 `8D$@ +88oobY'$@ +88`8b $@ +88 `88.$@ +88 YD$@ + $@ + $@@ +.d8888.$@ +88' YP$@ +`8bo. $@ + `Y8b.$@ +db 8D$@ +`8888Y'$@ + $@ + $@@ +d888888b$@ +`~~88~~'$@ + 88 $@ + 88 $@ + 88 $@ + YP $@ + $@ + $@@ +db db$@ +88 88$@ +88 88$@ +88 88$@ +88b d88$@ +~Y8888P'$@ + $@ + $@@ +db db$@ +88 88$@ +Y8 8P$@ +`8b d8'$@ + `8bd8' $@ + YP $@ + $@ + $@@ +db d8b db$@ +88 I8I 88$@ +88 I8I 88$@ +Y8 I8I 88$@ +`8b d8'8b d8'$@ + `8b8' `8d8' $@ + $@ + $@@ +db db$@ +`8b d8'$@ + `8bd8' $@ + .dPYb. $@ +.8P Y8.$@ +YP YP$@ + $@ + $@@ +db db$@ +`8b d8'$@ + `8bd8' $@ + 88 $@ + 88 $@ + YP $@ + $@ + $@@ +d88888D$@ +YP d8'$@ + d8' $@ + d8' $@ + d8' db$@ +d88888P$@ + $@ + $@@ + .8P$@ + 8' $@ + .dP $@ +C88 $@ + `Yb $@ + 8. $@ + `8b$@ + $@@ +8$@ +8$@ +8$@ + $@ +8$@ +8$@ +8$@ + $@@ +V8. $@ + `8 $@ + Vb. $@ + 88D$@ + dP' $@ + .8 $@ +C8' $@ + $@@ + .oo. .$@ +P' `VP'$@ + $@ + $@ + $@ + $@ + $@ + $@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ +@ +@ +@ +@ +@ +@ +@ +@@ diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 0000000..0a5cdf4 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,16 @@ +# test help +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -h +# test distroid +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -d arch +# test grep +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -g kernel +# test margin +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -m 1,2,3 +# test layout +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -l ArtOnTop +# test figletlogos mode +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -fe on +# test figletlogos margin +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -fe on -fm 1,2,3 +# test figletlogos font +./../bin/catnip -c ../config/config.toml -a ../config/distros.toml -fe on -ff basic.flf From e94b2701b5c3adf5c6bb644fbf7b4fcc63073b60 Mon Sep 17 00:00:00 2001 From: yuki Date: Mon, 6 May 2024 10:17:51 +0800 Subject: [PATCH 6/7] Fixed test.sh not executing correctly --- .github/workflows/build-test.yml | 1 + {test => tests}/basic.flf | 0 {test => tests}/test.sh | 0 3 files changed, 1 insertion(+) rename {test => tests}/basic.flf (100%) rename {test => tests}/test.sh (100%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 02774a5..244672c 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -22,4 +22,5 @@ jobs: - name: 'Install Figlet' run: sudo apt-get install figlet - name: 'Test Catnip' + run: cd tests run: ./test.sh diff --git a/test/basic.flf b/tests/basic.flf similarity index 100% rename from test/basic.flf rename to tests/basic.flf diff --git a/test/test.sh b/tests/test.sh similarity index 100% rename from test/test.sh rename to tests/test.sh From 2cca7b947ff210f315389d68998a9ea486cb048e Mon Sep 17 00:00:00 2001 From: yuki Date: Mon, 6 May 2024 10:19:53 +0800 Subject: [PATCH 7/7] Update build-test.yml Fixed syntax error... --- .github/workflows/build-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 244672c..7b5ad19 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -22,5 +22,4 @@ jobs: - name: 'Install Figlet' run: sudo apt-get install figlet - name: 'Test Catnip' - run: cd tests - run: ./test.sh + run: cd tests && ./test.sh