Add Oil shell specification tests
tests/spec/oil.scm: New file. tests/spec/check-spec: New file. tests/spec/Makefile.am: New file. configure.ac: Add the new Makefile. Makefile.am (check-spec): New rule for running Oil shell specification tests. (clean-local): New rule that tells Automake how to clean up the specification tests. .gitignore: Add tests/spec/oil and tests/spec/oil-link.
This commit is contained in:
parent
eb4b8bb61b
commit
f84b6235db
|
@ -15,4 +15,6 @@ pre-inst-env
|
||||||
scripts/geesh
|
scripts/geesh
|
||||||
tests/*.trs
|
tests/*.trs
|
||||||
tests/config.scm
|
tests/config.scm
|
||||||
|
tests/spec/oil
|
||||||
|
tests/spec/oil-link
|
||||||
tools/coverage
|
tools/coverage
|
||||||
|
|
|
@ -36,6 +36,10 @@ endif # HAVE_GENHTML
|
||||||
|
|
||||||
test-list: ; @echo $(TESTS)
|
test-list: ; @echo $(TESTS)
|
||||||
|
|
||||||
|
.PHONY: check-spec
|
||||||
|
check-spec:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) -L -C tests/spec check
|
||||||
|
|
||||||
MODULES = \
|
MODULES = \
|
||||||
geesh/built-ins/echo.scm \
|
geesh/built-ins/echo.scm \
|
||||||
geesh/built-ins/false.scm \
|
geesh/built-ins/false.scm \
|
||||||
|
@ -63,3 +67,6 @@ CLEANFILES = \
|
||||||
$(GOBJECTS) \
|
$(GOBJECTS) \
|
||||||
$(TESTS:tests/%.scm=%.log) \
|
$(TESTS:tests/%.scm=%.log) \
|
||||||
$(TESTS:tests/%.scm=%.trs)
|
$(TESTS:tests/%.scm=%.trs)
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) -L -C tests/spec clean
|
||||||
|
|
|
@ -14,6 +14,7 @@ AC_CONFIG_FILES([Makefile])
|
||||||
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
|
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
|
||||||
AC_CONFIG_FILES([scripts/geesh], [chmod +x scripts/geesh])
|
AC_CONFIG_FILES([scripts/geesh], [chmod +x scripts/geesh])
|
||||||
AC_CONFIG_FILES([tests/config.scm])
|
AC_CONFIG_FILES([tests/config.scm])
|
||||||
|
AC_CONFIG_FILES([tests/spec/Makefile])
|
||||||
AC_CONFIG_FILES([tools/coverage], [chmod +x tools/coverage])
|
AC_CONFIG_FILES([tools/coverage], [chmod +x tools/coverage])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
oil-link: oil.scm
|
||||||
|
if test -L oil-link; then unlink oil-link; fi
|
||||||
|
guix build --root=oil-link --file=oil.scm
|
||||||
|
|
||||||
|
oil: oil-link
|
||||||
|
rm -rf oil
|
||||||
|
cp -R -H oil-link "$@"
|
||||||
|
chmod -R u+w "$@"
|
||||||
|
|
||||||
|
oil/bin/geesh: oil
|
||||||
|
echo "#!/bin/sh" > "$@"
|
||||||
|
echo "$(abs_top_builddir)/pre-inst-env geesh" >> "$@"
|
||||||
|
chmod a+x "$@"
|
||||||
|
|
||||||
|
check: oil/bin/geesh ;
|
||||||
|
|
||||||
|
TEST_EXTENSIONS = .sh
|
||||||
|
SH_LOG_COMPILER = ./check-spec
|
||||||
|
|
||||||
|
TESTS = \
|
||||||
|
oil/spec/smoke.test.sh
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
rm -rf oil
|
||||||
|
if test -L oil-link; then unlink oil-link; fi
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd oil
|
||||||
|
export OSH_LIST=bin/geesh
|
||||||
|
|
||||||
|
test_name=$(basename "$1")
|
||||||
|
test_name=${test_name%.sh}
|
||||||
|
test_name=${test_name%.test}
|
||||||
|
|
||||||
|
./test/spec.sh "$test_name" --verbose
|
|
@ -0,0 +1,49 @@
|
||||||
|
(use-modules (gnu packages bash)
|
||||||
|
(gnu packages python)
|
||||||
|
(gnu packages time)
|
||||||
|
(guix gexp)
|
||||||
|
(guix git-download)
|
||||||
|
(guix modules)
|
||||||
|
(guix monads)
|
||||||
|
(guix packages)
|
||||||
|
(guix store))
|
||||||
|
|
||||||
|
(let* ((commit "4d10a3d2a477a9f4e0d92b8c1fe37c7ee9507aa8")
|
||||||
|
(version (git-version "0.6.pre5" "0" commit))
|
||||||
|
(source
|
||||||
|
(origin
|
||||||
|
(method git-fetch)
|
||||||
|
(uri (git-reference
|
||||||
|
(url "https://github.com/oilshell/oil.git")
|
||||||
|
(commit commit)))
|
||||||
|
(file-name (string-append "oil-" version "-checkout"))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"0gq3c4m4sz27qmfk6c6k0l7q0fas2gbal1yj0dd97yz3pgkl1vqz")))))
|
||||||
|
(run-with-store (open-connection)
|
||||||
|
(with-imported-modules (source-module-closure
|
||||||
|
'((guix build utils)))
|
||||||
|
(gexp->derivation
|
||||||
|
(string-append "oil-tests-" version)
|
||||||
|
#~(begin
|
||||||
|
(use-modules (guix build utils))
|
||||||
|
(copy-recursively #$source #$output)
|
||||||
|
(setenv "PATH" (list->search-path-as-string
|
||||||
|
(map (lambda (p)
|
||||||
|
(string-append p "/bin"))
|
||||||
|
(list #$bash-minimal
|
||||||
|
#$python-2
|
||||||
|
#$time))
|
||||||
|
":"))
|
||||||
|
(chdir #$output)
|
||||||
|
(for-each patch-shebang
|
||||||
|
'("spec/bin/argv.py"
|
||||||
|
"test/common.sh"
|
||||||
|
"test/sh_spec.py"
|
||||||
|
"test/spec-runner.sh"
|
||||||
|
"test/spec.sh"))
|
||||||
|
(substitute* "test/common.sh"
|
||||||
|
(("/usr/bin/env time") (which "time")))
|
||||||
|
;; This is not necessary, but it makes the output nicer.
|
||||||
|
(substitute* "test/spec.sh"
|
||||||
|
(("which \\$name") "which $name 2>/dev/null")))))))
|
Loading…
Reference in New Issue