From d3f2ad5edfc8b98f7c83b5197519fe35d3e0f07e Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Tue, 21 Sep 2021 20:31:21 +0100 Subject: [PATCH] regress: port cmdline tests This commit introduces the 'make tests' target which will run the cmdline/* tests. --- .gitignore | 1 + Makefile.am | 3 ++ README.portable | 15 +++++++- configure.ac | 3 +- regress/cmdline/Makefile.am | 92 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 regress/cmdline/Makefile.am diff --git a/.gitignore b/.gitignore index 234e1433..99173d49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/Makefile **/Makefile.in +**/Makefile.linux **/obj *.core *.o diff --git a/Makefile.am b/Makefile.am index d17b7430..2c07d62a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,3 +25,6 @@ AM_CFLAGS += -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare AM_CFLAGS += -Wundef -Wbad-function-cast -Winline -Wcast-align AM_CFLAGS += -Wdeclaration-after-statement -Wno-pointer-sign -Wno-attributes AM_CFLAGS += -Wno-unused-result + +tests: + $(MAKE) -C regress/cmdline -f Makefile.linux diff --git a/README.portable b/README.portable index 7a3db489..056822ac 100644 --- a/README.portable +++ b/README.portable @@ -23,6 +23,19 @@ Got requires the following libraries: Currently, these dependencies are searched for via pkg-config(1) which must also be installed. +TESTS (REGRESS) +=============== + +There are tests under regress/ -- these are designed to work on OpenBSD. For +now, the cmdline/ tests have been prioritised. + +To run the test suite: + + $ make tests + +NOTE: THIS ONLY WORKS AFTER 'make install' DUE TO HOW PATHS TO LIBEXEC + HELPERS ARE HARD-CODED INTO THE BINARIES. + INSTALLATION ============ @@ -34,7 +47,7 @@ TODO ==== This port is incomplete in that only got(1) and tog(1) have been ported. -gotweb and the test suite (regress) have yet to be ported. +gotweb has yet to be ported. configure.ac should start defining AC_ENABLE arguments to allow for finer-grained control of where to search for includes/libraries, etc. diff --git a/configure.ac b/configure.ac index dfa66e65..cdd6e159 100644 --- a/configure.ac +++ b/configure.ac @@ -396,7 +396,8 @@ AC_CONFIG_FILES([Makefile libexec/got-send-pack/Makefile got/Makefile gotadmin/Makefile - tog/Makefile]) + tog/Makefile + regress/cmdline/Makefile.linux:regress/cmdline/Makefile.am]) AC_OUTPUT # tog/GNUMakefile]) diff --git a/regress/cmdline/Makefile.am b/regress/cmdline/Makefile.am new file mode 100644 index 00000000..7c248ece --- /dev/null +++ b/regress/cmdline/Makefile.am @@ -0,0 +1,92 @@ +REGRESS_TARGETS=checkout update status log add rm diff blame branch tag \ + ref commit revert cherrypick backout rebase import histedit \ + integrate stage unstage cat clone fetch tree pack cleanup +NOOBJ=Yes + +GOT_TEST_ROOT=/tmp + +all: $(REGRESS_TARGETS) + +checkout: + ./checkout.sh -q -r "$(GOT_TEST_ROOT)" + +update: + ./update.sh -q -r "$(GOT_TEST_ROOT)" + +status: + ./status.sh -q -r "$(GOT_TEST_ROOT)" + +log: + ./log.sh -q -r "$(GOT_TEST_ROOT)" + +add: + ./add.sh -q -r "$(GOT_TEST_ROOT)" + +rm: + ./rm.sh -q -r "$(GOT_TEST_ROOT)" + +diff: + ./diff.sh -q -r "$(GOT_TEST_ROOT)" + +blame: + ./blame.sh -q -r "$(GOT_TEST_ROOT)" + +branch: + ./branch.sh -q -r "$(GOT_TEST_ROOT)" + +tag: + ./tag.sh -q -r "$(GOT_TEST_ROOT)" + +ref: + ./ref.sh -q -r "$(GOT_TEST_ROOT)" + +commit: + ./commit.sh -q -r "$(GOT_TEST_ROOT)" + +revert: + ./revert.sh -q -r "$(GOT_TEST_ROOT)" + +cherrypick: + ./cherrypick.sh -q -r "$(GOT_TEST_ROOT)" + +backout: + ./backout.sh -q -r "$(GOT_TEST_ROOT)" + +rebase: + ./rebase.sh -q -r "$(GOT_TEST_ROOT)" + +import: + ./import.sh -q -r "$(GOT_TEST_ROOT)" + +histedit: + ./histedit.sh -q -r "$(GOT_TEST_ROOT)" + +integrate: + ./integrate.sh -q -r "$(GOT_TEST_ROOT)" + +stage: + ./stage.sh -q -r "$(GOT_TEST_ROOT)" + +unstage: + ./unstage.sh -q -r "$(GOT_TEST_ROOT)" + +cat: + ./cat.sh -q -r "$(GOT_TEST_ROOT)" + +clone: + ./clone.sh -q -r "$(GOT_TEST_ROOT)" + +fetch: + ./fetch.sh -q -r "$(GOT_TEST_ROOT)" + +send: + ./send.sh -q -r "$(GOT_TEST_ROOT)" + +tree: + ./tree.sh -q -r "$(GOT_TEST_ROOT)" + +pack: + ./pack.sh -q -r "$(GOT_TEST_ROOT)" + +cleanup: + ./cleanup.sh -q -r "$(GOT_TEST_ROOT)" -- 2.11.4.GIT