Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Smoke instead of shelltestrunner #1710

Merged
merged 17 commits into from Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -262,19 +262,29 @@ jobs:
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name : Shell tests (Linux)
id: shell-tests-linux
- name: Download Smoke binary
uses: jaxxstorm/action-install-gh-release@v1.9.0
with:
repo: SamirTalwar/smoke
tag: v2.3.1
cache: enable
extension-matching: disable
rename-to: smoke
chmod: 0755

- name : Smoke testing (Linux)
id: smoke-linux
if: runner.os == 'Linux'
run : |
cd main
make test-shell
make smoke

- name : Shell tests (macOS)
id: shell-tests-macos
- name : Smoke testing (macOS)
id: smoke-macos
if: runner.os == 'macOS'
run : |
cd main
make CC=$CC LIBTOOL=$LIBTOOL test-shell
make CC=$CC LIBTOOL=$LIBTOOL smoke

docs:
needs: build
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Expand Up @@ -163,14 +163,14 @@ MAKE=make ${MAKEAUXFLAGS}

STACKFLAGS?=--jobs $(THREADS)
STACKTESTFLAGS?=--ta --hide-successes --ta --ansi-tricks=false
SHELLTESTFLAGS?=--color --diff -a --hide-successes
SMOKEFLAGS?=--color --diff=git

.PHONY: check
check: clean
@${MAKE} build
@${MAKE} install
@${MAKE} test
@${MAKE} test-shell
@${MAKE} smoke
@${MAKE} format
@${MAKE} pre-commit

Expand Down Expand Up @@ -221,12 +221,13 @@ test-skip-slow:
fast-test-skip-slow:
@stack test --fast ${STACKFLAGS} ${STACKTESTFLAGS} --ta '-p "! /slow tests/"'

SHELLTEST := $(shell command -v shelltest 2> /dev/null)
SMOKE := $(shell command -v smoke 2> /dev/null)

.PHONY : test-shell
test-shell : install
@$(if $(SHELLTEST),, stack install shelltestrunner)
shelltest ${SHELLTESTFLAGS} tests
.PHONY : smoke
smoke: install
@$(if $(SMOKE),, $(error "Smoke not found, please install it from https://github.com/SamirTalwar/smoke"))
@find tests/smoke -type f -name '*.smoke.yaml' \
-exec sh -c "echo -n 'Running {}'; echo ; ${SMOKE} ${SMOKEFLAGS} {}" \;

# -- Release

Expand Down
16 changes: 0 additions & 16 deletions tests/CLI/Commands/compile.test

This file was deleted.

21 changes: 0 additions & 21 deletions tests/CLI/Commands/dev/internal.test

This file was deleted.

10 changes: 0 additions & 10 deletions tests/CLI/Commands/dev/parse.test

This file was deleted.

3 changes: 0 additions & 3 deletions tests/CLI/Commands/dev/root.test

This file was deleted.

12 changes: 0 additions & 12 deletions tests/CLI/Commands/dev/termination.test

This file was deleted.

12 changes: 0 additions & 12 deletions tests/CLI/Commands/html.test

This file was deleted.

98 changes: 0 additions & 98 deletions tests/CLI/Commands/repl.test

This file was deleted.

25 changes: 0 additions & 25 deletions tests/CLI/Commands/typecheck.test

This file was deleted.

3 changes: 0 additions & 3 deletions tests/CLI/doctor.test

This file was deleted.

12 changes: 0 additions & 12 deletions tests/CLI/help.test

This file was deleted.

7 changes: 0 additions & 7 deletions tests/CLI/version.test

This file was deleted.

51 changes: 51 additions & 0 deletions tests/smoke/Commands/compile.smoke.yaml
@@ -0,0 +1,51 @@
working-directory: ./../../../tests

tests:
- name: shows-file-argument-for-autocompletion
command:
- juvix
- compile
- --help
stdout:
contains:
JUVIX_FILE
exit-status: 0

- name: minic-compilation
command:
shell:
- bash
script: |
juvix compile positive/MiniC/HelloWorld/Input.juvix -o hello.wasm
[ -f hello.wasm ]

stdout: ""
exit-status: 0

- name: hello-world
command:
shell:
- bash
script: |
cd ./../examples/milestone/HelloWorld
juvix compile HelloWorld.juvix
[ -f HelloWorld ]
./HelloWorld
exit-status: 0
stdout: |
hello world!

- name: flag-internal-build-dir
command:
shell:
- bash
script: |
temp=$(mktemp -d)
cd ./../examples/milestone/HelloWorld
juvix compile HelloWorld.juvix --internal-build-dir "$temp"
find "$temp" | wc -l
rm -rf "$temp"
stdout:
matches: |
\s*([2-9]|[1-9][0-9]+)
exit-status: 0