markt-asf commented on code in PR #260: URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081068406
########## src/native/windows/apps/prunsrv/test/scripts/testservice.bat: ########## @@ -0,0 +1,24 @@ +@ECHO OFF +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +call mybanner testing +java -cp %myjar% org.apache.commons.daemon.ProcrunDaemon 0 Review Comment: Where is the source for this class? ########## .github/workflows/windows.yml: ########## @@ -0,0 +1,86 @@ +# 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. + +name: Windows + +on: + push: + branches: [ "winbuild" ] Review Comment: Does this require a new branch? Why not run this on master? ########## .github/workflows/windows.yml: ########## @@ -0,0 +1,86 @@ +# 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. + +name: Windows + +on: + push: + branches: [ "winbuild" ] + paths-ignore: + - 'src/docs/**' + - 'src/main/java/**' + pull_request: + branches: [ "winbuild" ] + paths-ignore: + - 'src/docs/**' + - 'src/main/java/**' + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - name: Default + triplet: x64-windows + arch: x64 + build-type: Debug + generator: "Ninja" + + runs-on: windows-latest + timeout-minutes: 30 + name: ${{ matrix.name }} + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + steps: + - uses: actions/checkout@v4 + with: + ref: winbuild + - name: Test JAVA_HOME + shell: cmd + run: | + echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat Review Comment: Is this required in a temporary file? ########## src/native/windows/apps/prunsrv/test/scripts/test.bat: ########## @@ -0,0 +1,218 @@ +@ECHO OFF +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +rem --------------------------------------------------------------------------- +rem Test script for procrun +rem to run it you need: +rem 1 - the commons-daemon-*-tests.jar +rem 2 - procrun.exe in a subdirectory (usually something like WIN10_X64_EXE_RELEASE\prunsrv.exe) +rem 3 - use cmd/c test.bat in the command Prompt (cmd) +rem the test are OK once test.bat Done!!! is displayed at the test of the bat script. + +SETLOCAL ENABLEEXTENSIONS +SETLOCAL EnableDelayedExpansion +SET mypath=%cd% +WHERE /r ..\..\ prunsrv.exe 1>in.txt +SET /p myserv=<in.txt +WHERE /r ..\..\..\..\..\..\..\target *-tests.jar 1>in.txt +SET /p myjar=<in.txt +ECHO "myserv: %myserv%" +ECHO "myjar: %myjar%" +ECHO "%mypath: %mypath%" + +echo "cleaning..." +call mybanner stopping +%myserv% //SS//TestService +if %errorlevel% neq 0 ( + echo "Stop service failed" +) +call mybanner deleting +%myserv% //DS//TestService +if %errorlevel% equ 9 ( + echo "delete failed, not installed" +) else ( + if %errorlevel% neq 0 ( + echo "delete failed" + exit 1 + ) +) +echo "cleaned" + +rem install service with notimeout and no wait Review Comment: What is the difference between timeout and wait and where is this documented? The procrun docs only talk about timeout. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org