On Wed, Sep 25, 2024 at 2:29 PM Jun Omae <jun6...@gmail.com> wrote:
>
> On 2024/09/22 23:34, Timofei Zhakov wrote:
> > Hi,
> >
> > I am currently working on testing with CMake.
> >
> > I've noticed that there are some test scripts that implement custom
> > SVN_EDITOR. The files we currently have for this are:
> >
> > - svneditor.py: the editor itself.
> > - svneditor.bat: launches svneditor.py on Windows. The path to the
> > Python executable will be determined from the SVN_TEST_PYTHON
> > environment variable.
> > - svneditor.sh: launches svneditor.py on Unix. This file is configured
> > from svneditor.sh.in, and the path to the Python executable will be
> > inserted into the script in configure-time. The explained
> > configuration has been added in r1887324 [1].
> > - svneditor.sh.in: Template for svneditor.sh.
> >
> > Note: these files are located in the subversion\tests\cmdline directory.
> >
> > I'd like to suggest removing the configuration of the svneditor.sh
> > script, but put it into the repository and retrieve the path to the
> > Python executable from the SVN_TEST_PYTHON environment variable (how
> > it is on Windows).
> >
> > It will still ensure that we use the same Python as used for running tests.
> >
> > Attaching the patch as 'svn-svneditor-do-not-configure.patch.txt'
> >
> > Note: the source-tree should not be modified when configuring or
> > building using CMake, so simply adding configuration of this script is
> > complicated, because it should be configured into build dir.
> >
> > [1] https://svn.apache.org/viewvc?view=revision&revision=r1887324
> >
> > What do you think?
>
> Looks good to me. Also, I confirmed unit tests pass on both configure
> and cmake with make generator.
>
> I'd suggest two things:
>
>  - Add the following comment to svneditor.sh like svneditor.bat:
>
>    # SVN_TEST_PYTHON set by svntest/main.py
>
>  - Remove "svneditor.sh" from svn:ignore of subversion/tests/cmdline

Thanks for reviewing!

These suggestions look great to me. Attached a new patch as
'svn-svneditor-do-not-configure-v2.patch.txt' and wrote the
logmessage.

[[[
Fix command-line tests on Linux by removing configuration of svneditor.sh
script.

See also 'Removing configuration of svneditor.sh script?' thread on dev@ [1].

* configure.ac
  (configscripts): Do not configure 'svneditor.sh' script.
* subversion/tests/cmdline
  (svn:ignore): Remove 'svneditor.sh' from ignores.
* subversion/tests/cmdline/svneditor.sh: Rename from svneditor.sh.in and...
  (python path): Retrieve it from SVN_TEST_PYTHON environment variable instead
   of configuring it.
  (source dir): Using `$(dirname $0)` shell magic for determining source dir,
   instead of configuring it.
* subversion/tests/cmdline/svneditor.sh.in: Renamed to svneditor.sh.

[1] https://lists.apache.org/thread/b64t53r5055tv2s2b37r4wpk4qtw00y8
]]]

-- 
Timofei Zhakov
Index: configure.ac
===================================================================
--- configure.ac        (revision 1920916)
+++ configure.ac        (working copy)
@@ -1764,7 +1764,6 @@
 
 SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
 SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
-SVN_CONFIG_SCRIPT(subversion/tests/cmdline/svneditor.sh)
 SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
 if test -e packages/solaris/pkginfo.in; then
   SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
Index: subversion/tests/cmdline
===================================================================
--- subversion/tests/cmdline    (revision 1920916)
+++ subversion/tests/cmdline    (working copy)

Property changes on: subversion/tests/cmdline
___________________________________________________________________
Modified: svn:ignore
## -11,4 +11,3 ##
 .libs
 .davautocheck.sh.stop
 lock-helper
-svneditor.sh
Index: subversion/tests/cmdline/svneditor.sh
===================================================================
--- subversion/tests/cmdline/svneditor.sh       (nonexistent)
+++ subversion/tests/cmdline/svneditor.sh       (working copy)
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+#  svneditor.sh: a launcher of svneditor.py, used as $SVN_EDITOR
+#                for the Subversion test suite
+#
+#  Subversion is a tool for revision control.
+#  See https://subversion.apache.org for more information.
+#
+# ====================================================================
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied.  See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+######################################################################
+
+# SVN_TEST_PYTHON set by svntest/main.py
+exec $SVN_TEST_PYTHON "$(dirname $0)/svneditor.py" "$@"

Property changes on: subversion/tests/cmdline/svneditor.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: subversion/tests/cmdline/svneditor.sh.in
===================================================================
--- subversion/tests/cmdline/svneditor.sh.in    (revision 1920916)
+++ subversion/tests/cmdline/svneditor.sh.in    (nonexistent)
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-#  svneditor.sh.in: a launcher of svneditor.py, used as $SVN_EDITOR
-#                   for the Subversion test suite
-#
-#  Subversion is a tool for revision control.
-#  See https://subversion.apache.org for more information.
-#
-# ====================================================================
-#    Licensed to the Apache Software Foundation (ASF) under one
-#    or more contributor license agreements.  See the NOTICE file
-#    distributed with this work for additional information
-#    regarding copyright ownership.  The ASF licenses this file
-#    to you under the Apache License, Version 2.0 (the
-#    "License"); you may not use this file except in compliance
-#    with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing,
-#    software distributed under the License is distributed on an
-#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#    KIND, either express or implied.  See the License for the
-#    specific language governing permissions and limitations
-#    under the License.
-######################################################################
-
-exec @PYTHON@ "@abs_srcdir@"/svneditor.py "$@"

Property changes on: subversion/tests/cmdline/svneditor.sh.in
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property

Reply via email to