Add --test flag to jpm.

Also test some select packages when testing installation.
This is used in CI to make sure that versions of Janet work with
the most libraries.
This commit is contained in:
Calvin Rose 2019-11-09 10:03:56 -06:00
parent 1f55d40a10
commit 8911daaf6c
5 changed files with 23 additions and 2 deletions

View File

@ -353,7 +353,10 @@ test-install:
&& build/testexec \
&& jpm --verbose quickbin testexec.janet build/testexec2 \
&& build/testexec2 \
&& jpm --verbose --modpath=. install https://github.com/janet-lang/json.git
&& jpm --verbose --testdeps --modpath=. install https://github.com/janet-lang/json.git
cd test/install && jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
cd test/install && jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
cd test/install && jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
build/embed_janet.o: build/janet.c $(JANET_HEADERS)
$(CC) $(CFLAGS) -c $< -o $@

View File

@ -775,6 +775,8 @@ int main(int argc, const char **argv) {
(os/mkdir manifests)
(spit manifest (string (string/join installed-files "\n") "\n")))
(phony "install" ["uninstall" "build" "manifest"]
(when (dyn :test)
(do-rule "test"))
(print "Installed as '" (meta :name) "'."))
(phony "install-deps" []
@ -857,6 +859,7 @@ Keys are:
Flags are:
--verbose : Print shell commands as they are executed.
--test : If passed to jpm install, runs tests before installing. Will run tests recursively on dependencies.
`))
(defn- show-help

View File

@ -183,6 +183,12 @@ call jpm --verbose quickbin testexec.janet build\testexec2.exe
@if errorlevel 1 goto :TESTFAIL
call build\testexec2.exe
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/jhydro.git
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/path.git
@if errorlevel 1 goto :TESTFAIL
call jpm --verbose --test --modpath=. install https://github.com/janet-lang/argparse.git
@if errorlevel 1 goto :TESTFAIL
popd
exit /b 0

4
jpm.1
View File

@ -28,6 +28,10 @@ More interesting are the local commands. For more information on jpm usage, see
.BR \-\-verbose
Print detailed messages of what jpm is doing, including compilation commands and other shell commands.
.TP
.BR \-\-test
If passed to jpm install, runs tests before installing. Will run tests recursively on dependencies.
.SH OPTIONS
.TP

View File

@ -1,4 +1,9 @@
/build
.cache
.manifest
.manifests
json.*
jhydro.*
circlet.*
argparse.*
sqlite3.*
path.*