Re: [PATCH v3 4/8] cmake: support for testing git with ctest
- From
Sibi Siddharthan <sibisiddharthan.github@gmail.com>
- Date
- May 30, 2020, 19:04 UTC
- Message-ID
- <CAKiG+9WxoffdtQPvVk=8nG+Q58VvrCd4T41bP3ef3wn+FV8h4A@mail.gmail.com>
- In-Reply-To
- <20200530134923.GB2151@danh.dev>
On Sat, May 30, 2020 at 7:19 PM Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
Show 16 quoted lines
> > On 2020-05-29 13:40:20+0000, Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com> wrote: > > From: Sibi Siddharthan <sibisiddharthan.github@gmail.com> > > > > This patch provides an alternate way to test git using ctest. > > CTest ships with CMake, so there is no additional dependency being > > introduced. > > > > To perform the tests with ctest do this after building: > > ctest -j[number of jobs] > > Or we can just run: make test > CMake will run: ctest itself. > > Ah, OK, that's not equivalence. make -j9 test doesn't work :/ >
No, it does not. make test -> ctest --force-new-ctest-process.
Show 6 quoted lines
> Anyway, there're test is failing in Linux with this CMake. > > $git_repo/t/../build/bin-wrappers/git is not executable; using GIT_EXEC_PATH > > It looks like CMake Generator forgets "chmod +x bin-wrappers/git" >
CMake does not support changing permissions of files easily. You have to juggle them around to a temporary location and change the permissions when you do `file(COPY ...)`.
Will look into this.
Show 9 quoted lines
> > Test time = 1.11 sec > > > > NOTE: Testing only works when building in source for now. > > OK, so this maybe the pain point, let me build in source again. > Hm, no, I still see the same problems. > Worse, CMake overrides my current Makefile. > Luckily, I don't have any changes in Makefile. >
Please read the next PATCH, it supports out of source building and testing.
Show 6 quoted lines
> > +endif()#BUILD_TESTING > > We can use: > > endif(BUILD_TESTING) >
The docs suggest that this way of endif() is for backwards compat only. Not sure if I should change this, as CMake might remove this in the future(very unlikely though).
Thank You, Sibi Siddharthan
> -- > Danh