redundant cprotect's

Scott Kostyshak skostysh at lyx.org
Sat Sep 30 18:29:57 UTC 2023


On Sat, Sep 30, 2023 at 12:06:18AM +0300, Udicoudco wrote:
> On Thu, Sep 28, 2023 at 6:19 PM Scott Kostyshak <skostysh at lyx.org> wrote:
> >
> > On Thu, Sep 28, 2023 at 04:34:45PM +0300, Udicoudco wrote:
> > > Hello all,
> > >
> > > Can anyone think of a simple case where cprotect is used?
> > > I think we have some redundant cases where we can remove
> > > the protection (such as before \L or \R because they don't really
> > > take an argument), and I want to test that.
> >
> > We have some test documents. Do you by chance use CMake to build LyX? If
> > so, add the flag "-DLYX_ENABLE_EXPORT_TESTS=ON" in your 'cmake' call
> > (unfortunately this flag adds some time, e.g., 20 seconds) and then you
> > can run:
> >
> >   ctest -R "cprotect"
> >
> > First run that to confirm the tests currently pass for you (all 30 do
> > for me).
> >
> > Then make the code change and run those tests again.
> >
> > Those tests took just 42 seconds to run serially, but if you want to
> > speed things up, you can run them in parallel, e.g.:
> >
> >   ctest -j8 -R "cprotect"
> >
> > This took 10 seconds.
> >
> > If something in the above process doesn't work, let us know and we can
> > try to figure it out. I think only Kornel and I have been running the
> > ctests so it would be great to have other testers.
> 
> I don't yet tried to use CMake to build LyX, But I'm actually plan to do
> a fresh install on my windows machine. I've read that it is recommended
> to use CMake to build LyX on windows, so I'll almost surely give it a try.
> Hopefully I'll be able to set up a proper environment without any troubles.
> Thanks for all the details!

Sounds good!

> 
> > If you don't want to use the ctests, you can also search the repository
> > for "cprotect" to find the test documents. It would be great to have
> > some test documents in Hebrew if you can contribute some. Currently, I
> > think our tests only check compilation errors. i.e., they don't check
> > that the appearance is correct.
> 
> I'm not sure I follow.

The main thing I wanted to say is that those are examples of documents
that use cprotect so you could look at those since I thought you wanted
such examples.

> Did you mean that the current Hebrew test files
> only test for compilation errors?

Most export tests only check compilation success. We also check a couple
other things, but not appearance.

> or that in general, if I would like
> to contribute
> some test files, the appearance is not a factor for the document?

Yes, if you have any documents where you think it would be helpful to
ensure that they still compile, those would be good candidates.

> How do the tests check for errors? Does the .log file get parsed
> somehow or we are
> only interested in major errors and not warning?

Currently I believe we only check the return code (of "lyx -e ...").  If
you have any specific idea for warnings it would be good to grep for, we
might be able to look into that.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230930/b536a735/attachment-0001.asc>


More information about the lyx-devel mailing list