[CMake] LastTest log file name?

2019-10-07 Thread Donald MacQueen [|] via CMake
Ctest creates a log file in ../build/Testing/Temporary with a name like 
LastTest_MMDD_HHMM.


Is there a way I an add some descriptions to this name?

For example, LastTest_MMDD_HHMM_MyTestDescription.

Thanks in advance.

--
Donald [|]
A bad day in [] is better than a good day in {}.


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Make Timeout not be a failure

2019-06-20 Thread Donald MacQueen [|] via CMake

HI Kyle,

Where are the -D and the -P switches of add_test documented?

Thanks for the suggestion.

On 6/20/2019 3:52 PM, Kyle Edwards wrote:

On Thu, 2019-06-20 at 15:45 -0400, Donald MacQueen [|] via CMake wrote:

I have a test where I start a program that I know will create some
output that I can test.

But I have no way to kill this program, so I let Ctest kill it with
a
TIMEOUT.

The next step greps the output to see if it worked.

So it would be nice if  PASS_REGULAR_EXPRESSION  could override
TIMEOUT
and not mark the test as failed.

For example:

  set_tests_properties(${importMaps} PROPERTIES
PASS_REGULAR_EXPRESSION "some string I know I will find")
      # this
^^ makes the test pass even if it times out
      set_tests_properties(${importMaps} PROPERTIES TIMEOUT 60)

You could wrap your test in a CMake script that calls execute_process()
with a TIMEOUT argument, and then greps the output of the command for
the desired expression. For example:

CMakeLists.txt:

add_test(NAME mytest COMMAND ${CMAKE_COMMAND} -DMYEXE=${PATH_TO_MYEXE}
-P ${CMAKE_CURRENT_LIST_DIR}/ExecuteTest.cmake)

ExecuteTest.cmake:

execute_process(COMMAND ${PATH_TO_MYEXE} TIMEOUT 60 OUTPUT_VARIABLE
output)
if(NOT output MATCHES "^my_desired_regex$")
   message(FATAL_ERROR "myexe did not produce desired output")
endif()

Hope that helps

Kyle


--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Make Timeout not be a failure

2019-06-20 Thread Donald MacQueen [|] via CMake
I have a test where I start a program that I know will create some 
output that I can test.


But I have no way to kill this program, so I let Ctest kill it with a 
TIMEOUT.


The next step greps the output to see if it worked.

So it would be nice if  PASS_REGULAR_EXPRESSION  could override TIMEOUT 
and not mark the test as failed.


For example:

    set_tests_properties(${importMaps} PROPERTIES 
PASS_REGULAR_EXPRESSION "some string I know I will find")
    # this 
^^ makes the test pass even if it times out

    set_tests_properties(${importMaps} PROPERTIES TIMEOUT 60)

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] How to use sudo in CTest

2019-05-15 Thread Donald MacQueen [|] via CMake

I have a suite of CTests that install and test our product on Ubuntu.

The installer requires sudo to run. I have been running the whole suite 
as sudo, which is not a great idea.


So I have toyed with trying to run just the installer with sudo, but no 
luck so far.


I configured sudo to run without asking for a password and that runs fine.

But these CTest COMMANDS do not:

add_test(NAME install COMMAND sudo ./vainstall aParameter )

add_test(NAME install COMMAND "sudo ./vainstall aParameter" )

What am I doing wrong?

Thanks in advance.

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] CDash grid display disappeared

2019-05-07 Thread Donald MacQueen [|] via CMake
I was on vacation last week, so testing resumed Monday. All of the seven 
machines running CTests say they are reporting their results to the 
CDash server, and on the CDash machine I can see results like:


33 minutes ago: 1 test failed on Machine 3

1 hour ago: 23 tests failed on Machine 7,

etc.

But the grid/spreadsheet is gone, and I can't figure out how to get it 
to display again.


Thanks in advance.

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Cdash - Display Start Time in local time zone

2019-02-12 Thread Donald MacQueen [|] via CMake

Greetings,

I understand that start times are stored in UTC.

But I would like the Start Time column in the Dashboard window to 
display those times in my local time zone of 'America/New York' or EST.


I have looked at the code in index.php, but I am not a php expert.

2) Running date in Ubuntu gets this: Tue Feb 12 21:47:16 EST 2019

So why is the CDash browser showing the current time in UTC? Wednesday, 
February 13 2019 02:41:47.


I have my project nightly start time set to 00:00:01 EST.

Thanks in advance.

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Removing builds from CDash

2019-01-12 Thread Donald MacQueen [|] via CMake
This page 
(https://vtk.org/Wiki/CDash:Administration#Delete_builds_with_wrong_dates) 
has a section titled Automatic removal of builds which describes two 
ways of removing builds.


The first is to set $CDASH_AUTOREMOVE_BUILDS='1';

The second is to run a cron job:  0 6 * * 0 php5 
/var/www/CDash/autoRemoveBuilds.php all


But my CDash 2.6.0 does not have an autoRemoveBuilds.php file. It does 
have autoRemove.php, but running it does nothing,


What am I missing here?

Thanks


--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] CDash documentation suggestions

2019-01-03 Thread Donald MacQueen [|] via CMake
I had a difficult time getting CDash to work even though I am familiar 
with MySQL.


Here are some suggestions for the documentation:

1) CDash requires these Python modules (

 * bcmath
 * cURL (for site statistics)
 * GD (for regression tests)
 * mbstring
 * pdo-mysql or pdo-postgresql
 * XSL

). One of the distros I found installed these modules by default. I did 
not know this until I ran php -m which displays what modules are installed.


2) For security reasons, MySQL no longer allows you to set the initial 
password from a regular (non-sudo) command line unless you ssh in.  
Entering


sudo mysql -u root -p

and then typing the root password works. You can also do it like this:

||ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 
'yourPassword';||


3) The easiest way to do the initial MySQL configuration is to edit (or 
create) /etc/mysql/my.cnf, add these lines,


[mysqld]
sql-mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

and then restart MySQL.

sudo mysqld restart

4) This 
(https://askubuntu.com/questions/337874/change-apache-document-root-folder-to-secondary-hard-drive) 
is an example of how to change DocumentRoot to point to the CDash 
directory. Remember to restart Apache2 afterwards:


|sudo /etc/init.d/apache2 restart|

5) Finally, the docs say you should initially go to

||http://localhost/users.php||

This will not work until you first do the install from here:

||http://localhost/install.php ||

||If you get a database connection refused while doing the install, your 
MySQL password is probably not set correctly.||




||Hope this helps,||



||
||

--
Donald [|]
A bad day in [] is better than a good day in {}.



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Help with non-standard use of CMake

2019-01-02 Thread Donald MacQueen [|] via CMake

Hi Kyle,

I looked at the example of Using ctest and cdash without cmake 
(https://gitlab.kitware.com/cmake/community/wikis/doc/ctest/Using-CTEST-and-CDASH-without-CMAKE#steercmake) 
and I think I will try to go in that direction.


Part of my confusion is that I inherited this from a former employee and 
have been learning by doing/hacking.


Thanks for the reply.

On 1/2/2019 9:39 AM, Kyle Edwards wrote:

On Tue, 2019-01-01 at 16:55 -0500, Donald MacQueen [|] wrote:

No. CMakelists.txt does nothing but download the correct installer
(32 or 64 bit) from our server, set a bunch of variables, and then
run CTest.  I invoke the InstallShield installer from a command line
in a CTest.
There is no project, no make, no compile, no build. Just set a bunch
of variables and run CTest.
I think from what Kyle said I need to migrate(?) this to a script
that can be called from CTest directly, e.g., ctest -D Experimental
-S cdash.txt.
Thanks for the reply.

If CMakeLists.txt is only downloading and running an installer, then
perhaps it would be best to move this step into your CTest dashboard
script as you suggested. Your CMakeLists.txt is generating the
CTestTestfile.cmake file for you, but you can also write this file
yourself with a series of add_test() calls, which would enable you to
completely get rid of CMakeLists.txt.

If you're not comfortable doing this, you can also just do project(foo
LANGUAGES NONE) in your CMakeLists.txt as has already been suggested.

FWIW, the usual convention for CMake scripts is for anything other than
CMakeLists.txt to have a .cmake extension (though this isn't enforced,
it's just a convention.) And the -D argument to CTest isn't necessary
when running a dashboard script. So your CTest invocation would look
like this:

ctest -S dashboard.cmake

You can also have this script run ctest_configure(), which will run
CMake for you (if you decide not to migrate from CMakeLists.txt) so you
don't have to do it in the batch file.

Good luck, and let us know if you have any more questions!

Kyle


--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Help with non-standard use of CMake

2019-01-01 Thread Donald MacQueen [|] via CMake


On 1/1/2019 4:48 PM, frodak17 wrote:



I'm trying to follow along but you are calling cmake to do the install 
and set everything up before you run ctest.

And that the software was already built and packaged separately.



No. CMakelists.txt does nothing but download the correct installer (32 
or 64 bit) from our server, set a bunch of variables, and then run 
CTest.  I invoke the InstallShield installer from a command line in a CTest.


There is no project, no make, no compile, no build. Just set a bunch of 
variables and run CTest.


I think from what Kyle said I need to migrate(?) this to a script that 
can be called from CTest directly, e.g., ctest -D Experimental -S cdash.txt.


Thanks for the reply.


--
Donald [|]
A bad day in [] is better than a good day in {}.



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Help with non-standard use of CMake

2018-12-31 Thread Donald MacQueen [|] via CMake

On 12/31/2018 4:38 PM, Kyle Edwards wrote:

On Mon, 2018-12-31 at 16:16 -0500, Donald MacQueen [|] via CMake wrote:

First, CMake is quite impressive. Nice job.

I am using it in a non-standard way where I set a bunch of variables
and
then go straight to CTest thatI installs our software and then runs
several hundred tests on it. The batch file looks like this:

rmdir /s/q build
mkdir build
cd build
cmake -Dx64=%x64% -Doption:STRING="%opt%" ..
ctest -D Experimental -S

I do not make or build or compile.

I recently hooked this up to a CDash server which is very handy. I
want
to get the results that are sent to CDash, currently from Windows
only,
to be all green.

However, I am a little curious about what you're doing in your use
case. You say you're not building anything. Does your sofware exist in
the form of scripts (Python, Perl, etc.), or are you downloading pre-
built binaries from somewhere?


The purpose here is to 1) test that the installation of our product is 
successful (all the files are there with the correct permissions, etc.) 
and 2) that the 13k+ tests we have run correctly after installation.  
The installer is created using Install Shield.


My CMakelists.txt looks something like this:

++

cmake_minimum_required(VERSION 2.8.8)
if(CMAKE_VERSION VERSION_GREATER "3.1")
  cmake_policy(SET CMP0054 NEW)
endif()


if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "64")
    set (vasttst_isX86_OS FALSE)
    set (vasttst_OsBitness 64)
endif()
    set (vasttst_isX86_OS TRUE)
    set (vasttst_OsBitness 86)
endif ()

200 more lines..

ENABLE_TESTING()

include(CTest)

add_subdirectory(test)

++


Without knowing more details about what you're doing, it's possible
that dashboard scripts might be more suited for your use case... though
I see you have a -S argument at the end of your ctest invocation but no
script after it... what's the purpose of this?


The -S is probably left over from when I was trying to set the build 
name from a script.  I did a lot of looking around and did not see a 
dashboard script that did CTest only.


If I understand what you are saying, I could put all the set variable 
stuff above in a file called cdash.txt and then simply run


rmdir /s/q build
mkdir build
cd build
ctest -D Experimental -S cdash.txt

That way I avoid make/build/compile and go straight to CTest.

Right?

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Help with non-standard use of CMake

2018-12-31 Thread Donald MacQueen [|] via CMake

First, CMake is quite impressive. Nice job.

I am using it in a non-standard way where I set a bunch of variables and 
then go straight to CTest thatI installs our software and then runs 
several hundred tests on it. The batch file looks like this:


rmdir /s/q build
mkdir build
cd build
cmake -Dx64=%x64% -Doption:STRING="%opt%" ..
ctest -D Experimental -S

I do not make or build or compile.

I recently hooked this up to a CDash server which is very handy. I want 
to get the results that are sent to CDash, currently from Windows only, 
to be all green.


Under Build I have one error: Build log line 2. The system cannot find 
the file specified. CMake Error: Generator: execution of make failed. 
Make command was: "nmake" "/nologo" "-i"


Under Build I have one warning: Build log line 1. *** WARNING non-zero 
return value in ctest from: C:\Program Files\CMake\bin\cmake.exe


Is there a way to suppress the execution of these steps or their error 
messages?


Thanks,

Donald

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Accessing ${SITE} in CTestConfig.cmake

2018-12-31 Thread Donald MacQueen [|] via CMake

Thanks very much Kyle. I guess I am not real clear about when vars
should be used as var versus ${var}.

On 12/31/2018 10:08 AM, Kyle Edwards wrote:

On Sat, 2018-12-29 at 09:01 -0500, Donald MacQueen [|] wrote:

My machine shows up as M6800 under Site in my remote dashboard.

I want to use my local dashboard, so I did this in
CTestConfigCTestConfig.cmake:

IF (${SITE} STREQUAL "M6800")
  set(CTEST_DROP_SITE "192.168.49.128") # <---
--
local dashboard
ELSE()
  set(CTEST_DROP_SITE "192.168.10.150")
ENDIF()

I also tried IF (${CTEST_SITE} STREQUAL "M6800") with no luck.

Any ideas?

Thanks.

--
Donald [|]
A bad day in [] is better than a good day in {}.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Donald,

Try this instead:

if(CTEST_SITE STREQUAL "M6800")
# ...

See the documentation for the if() command to understand how to use it:

https://cmake.org/cmake/help/latest/command/if.html

Kyle


--
Donald [|]
A bad day in [] is better than a good day in {}.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake