From aed2d0caf23b43a2cc3abea973a243a841758faf Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 1 May 2022 13:38:30 +0300 Subject: [PATCH] make files: add a `make check` target, that runs `v test-all` locally --- GNUmakefile | 4 +++- Makefile | 5 +++++ make.bat | 21 ++++++++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 130c68172..aab552aa1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -76,7 +76,7 @@ endif endif endif -.PHONY: all clean fresh_vc fresh_tcc check_for_working_tcc +.PHONY: all clean check fresh_vc fresh_tcc check_for_working_tcc ifdef prod VFLAGS+=-prod @@ -164,3 +164,5 @@ selfcompile-static: install: @echo 'Please use `sudo ./v symlink` instead.' +check: + $(V) test-all diff --git a/Makefile b/Makefile index c172fb3e4..67d579a99 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ VFLAGS ?= CFLAGS ?= LDFLAGS ?= +.PHONY: all check + all: rm -rf vc/ git clone --depth 1 --quiet https://github.com/vlang/vc @@ -12,3 +14,6 @@ all: rm -rf v1 v2 vc/ @echo "V has been successfully built" ./v run ./cmd/tools/detect_tcc.v + +check: + ./v test-all diff --git a/make.bat b/make.bat index a9fb39f91..483d60637 100644 --- a/make.bat +++ b/make.bat @@ -39,7 +39,7 @@ if !shift_counter! LSS 1 ( if "%~1" == "help" ( if not ["%~2"] == [""] set "subcmd=%~2"& shift& set /a shift_counter+=1 ) - for %%z in (build clean cleanall help) do ( + for %%z in (build clean cleanall check help) do ( if "%~1" == "%%z" set target=%1& shift& set /a shift_counter+=1& goto :verifyopt ) ) @@ -67,6 +67,12 @@ exit /b 2 :init goto :!target! +:check +echo. +echo Check everything +v.exe test-all +exit /b 0 + :cleanall call :clean if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL% @@ -259,10 +265,11 @@ echo Compiler: echo -msvc ^| -gcc ^| -tcc ^| -tcc32 ^| -clang Set C compiler echo. echo Target: -echo build[default] Compiles V using the given C compiler -echo clean Clean build artifacts and debugging symbols -echo cleanall Cleanup entire ALL build artifacts and vc repository -echo help Display usage help for the given target +echo build[default] Compiles V using the given C compiler +echo clean Clean build artifacts and debugging symbols +echo cleanall Cleanup entire ALL build artifacts and vc repository +echo check Check that tests pass, and the repository is in a good shape for Pull Requests +echo help Display help for the given target echo. echo Examples: echo make.bat -msvc @@ -304,8 +311,8 @@ echo Compiler: echo -msvc ^| -gcc ^| -tcc ^| -tcc32 ^| -clang Set C compiler echo. echo Options: -echo --local Use the local vc repository without -echo syncing with remote +echo --local Use the local vc repository without +echo syncing with remote exit /b 0 :bootstrap_tcc -- 2.30.2