Skip to content

Commit 635db76

Browse files
committed
fix tests
1 parent cbdabe1 commit 635db76

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

ci/all_tests.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ rm -rf dirExampleE
9797
rm -rf dirExampleA
9898
rm -rf dirExampleD
9999

100+
# countdown, echo, form... all require user input or special setup
101+
ignore_list=("stdin-basic.roc" "stdin-pipe.roc" "command-line-args.roc" "http.roc" "env-var.roc" "bytes-stdin-stdout.roc" "error-handling.roc" "tcp-client.roc" "tcp.roc" "terminal-app-snake.roc")
102+
100103
# roc dev (some expects only run with `roc dev`)
101104
for roc_file in $EXAMPLES_DIR*.roc; do
102105
base_file=$(basename "$roc_file")
103106

104-
# countdown, echo, form... all require user input or special setup
105-
ignore_list=("stdin-basic.roc" "stdin-pipe.roc" "command-line-args.roc" "http.roc" "env-var.roc" "bytes-stdin-stdout.roc" "error-handling.roc" "tcp-client.roc" "terminal-app-snake.roc")
106107

107108
# check if base_file matches something from ignore_list
108109
for file in "${ignore_list[@]}"; do
@@ -130,9 +131,17 @@ for roc_file in $EXAMPLES_DIR*.roc; do
130131
$ROC dev $roc_file $ROC_BUILD_FLAGS
131132
fi
132133
done
134+
133135
for roc_file in $TESTS_DIR*.roc; do
134136
base_file=$(basename "$roc_file")
135137

138+
# check if base_file matches something from ignore_list
139+
for file in "${ignore_list[@]}"; do
140+
if [ "$base_file" == "$file" ]; then
141+
continue 2 # continue the outer loop if a match is found
142+
fi
143+
done
144+
136145
if [ "$base_file" == "sqlite.roc" ]; then
137146
DB_PATH=${TESTS_DIR}test.db $ROC dev $roc_file $ROC_BUILD_FLAGS
138147
else

flake.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
rust =
3131
pkgs.rust-bin.fromRustupToolchainFile "${toString ./rust-toolchain.toml}";
3232

33+
aliases = ''
34+
alias testcmd='export ROC=roc && export EXAMPLES_DIR=./examples/ && ./ci/all_tests.sh'
35+
'';
36+
3337
linuxInputs = with pkgs;
3438
lib.optionals stdenv.isLinux [
3539
valgrind
@@ -64,6 +68,10 @@
6468
# for crti.o, crtn.o, and Scrt1.o
6569
NIX_GLIBC_PATH =
6670
if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
71+
72+
shellHook = ''
73+
${aliases}
74+
'';
6775
};
6876

6977
formatter = pkgs.nixpkgs-fmt;

0 commit comments

Comments
 (0)