diff --git a/Makefile b/Makefile index 3ba1d0f5..5935b63e 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ diff --git a/auxbin/jpm b/auxbin/jpm index c6caa058..22483195 100755 --- a/auxbin/jpm +++ b/auxbin/jpm @@ -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 diff --git a/build_win.bat b/build_win.bat index ea97039e..163ce858 100644 --- a/build_win.bat +++ b/build_win.bat @@ -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 diff --git a/jpm.1 b/jpm.1 index 68c116b0..809875a3 100644 --- a/jpm.1 +++ b/jpm.1 @@ -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 diff --git a/test/install/.gitignore b/test/install/.gitignore index 8ffb5abc..c230d0a4 100644 --- a/test/install/.gitignore +++ b/test/install/.gitignore @@ -1,4 +1,9 @@ /build .cache -.manifest +.manifests json.* +jhydro.* +circlet.* +argparse.* +sqlite3.* +path.*