diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-07-10 19:18:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-02 13:33:54 (GMT) |
commit | 3c8a5aad46ddbd1d0e4c02f09bd403601c6c94b3 (patch) | |
tree | ef75de24b04753eb077734c4d33e6387eebce448 | |
parent | 2d74e54661953a02efa155ffe8c093400e5389c3 (diff) | |
download | CMake-3c8a5aad46ddbd1d0e4c02f09bd403601c6c94b3.zip CMake-3c8a5aad46ddbd1d0e4c02f09bd403601c6c94b3.tar.gz CMake-3c8a5aad46ddbd1d0e4c02f09bd403601c6c94b3.tar.bz2 |
Tests: Write tests for cthwalloc helper tool
This helper tool is sufficiently complex that it warrants having its
own test suite.
45 files changed, 284 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 45c549b..0925c0e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -367,6 +367,12 @@ else() set_property(TARGET cthwalloc PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR}) endif() +if(TARGET cthwalloc) + add_RunCMake_test(CTestHardwareAllocation -DCTHWALLOC_COMMAND=$<TARGET_FILE:cthwalloc>) +else() + message(WARNING "Could not find or build cthwalloc") +endif() + find_package(Qt4 QUIET) find_package(Qt5Core QUIET) if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) diff --git a/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake new file mode 100644 index 0000000..aa249d4 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/RunCMakeTest.cmake @@ -0,0 +1,136 @@ +include(RunCMake) + +############################################################################### +# Test cthwalloc itself - we want to make sure it's not just rubber-stamping +# the test results +############################################################################### + +function(cthwalloc_verify_log expected_contents) + if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log") + string(APPEND RunCMake_TEST_FAILED "Log file was not written\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + return() + endif() + file(READ "${RunCMake_TEST_BINARY_DIR}/cthwalloc.log" actual_contents) + if(NOT actual_contents STREQUAL expected_contents) + string(APPEND RunCMake_TEST_FAILED "Actual log did not match expected log\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +function(run_cthwalloc_write_proc name proc) + file(REMOVE "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log") + run_cthwalloc_write_proc_nodel("${name}" "${proc}" "${ARGN}") +endfunction() + +function(run_cthwalloc_write_proc_nodel name proc) + string(REPLACE ";" "\\;" proc "${proc}") + run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTHWALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log" "${name}" 0 "${proc}") +endfunction() + +function(run_cthwalloc_write_noproc name) + run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTHWALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/cthwalloc.log" "${name}" 0) +endfunction() + +function(run_cthwalloc_verify name tests) + string(REPLACE ";" "\\;" tests "${tests}") + run_cmake_command(${name} "${CTHWALLOC_COMMAND}" verify "${RunCMake_SOURCE_DIR}/${name}.log" "${CMAKE_CURRENT_LIST_DIR}/hwspec.json" "${tests}") +endfunction() + +unset(ENV{CTEST_PROCESS_COUNT}) +set(RunCMake_TEST_NO_CLEAN 1) +file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build") +file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build") +file(WRITE "${RunCMake_BINARY_DIR}/cthwalloc-write-proc-good1-build/cthwalloc.log" +[[begin test1 +alloc widgets 0 1 +dealloc widgets 0 1 +end test1 +]]) +run_cthwalloc_write_proc_nodel(cthwalloc-write-proc-good1 "1,widgets=2,transmogrifiers=1;2,widgets=1,widgets=2" + CTEST_PROCESS_COUNT=3 + CTEST_PROCESS_0=widgets,transmogrifiers + CTEST_PROCESS_0_WIDGETS=id:0,slots:2 + CTEST_PROCESS_0_TRANSMOGRIFIERS=id:calvin,slots:1 + CTEST_PROCESS_1=widgets + "CTEST_PROCESS_1_WIDGETS=id:0,slots:1\\;id:2,slots:2" + CTEST_PROCESS_2=widgets + "CTEST_PROCESS_2_WIDGETS=id:0,slots:1\\;id:2,slots:2" + ) +set(RunCMake_TEST_NO_CLEAN 0) +run_cthwalloc_write_proc(cthwalloc-write-proc-good2 "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + CTEST_PROCESS_0_WIDGETS=id:3,slots:8 + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-nocount "widgets=8") +run_cthwalloc_write_proc(cthwalloc-write-proc-badcount "widgets=8" + CTEST_PROCESS_COUNT=2 + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-nores "widgets=8" + CTEST_PROCESS_COUNT=1 + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badres "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets,transmogrifiers + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-nowidgets "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets1 "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + CTEST_PROCESS_0_WIDGETS= + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets2 "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + "CTEST_PROCESS_0_WIDGETS=id:3,slots:8\\;id:0,slots:1" + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets3 "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + CTEST_PROCESS_0_WIDGETS=id:3,slots:7 + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets4 "widgets=8" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + CTEST_PROCESS_0_WIDGETS=invalid + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets5 "widgets=2,widgets=2" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + "CTEST_PROCESS_0_WIDGETS=id:0,slots:2\\;id:0,slots:1" + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets6 "widgets=2" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + "CTEST_PROCESS_0_WIDGETS=id:0,slots:2\\;id:0,slots:1" + ) +run_cthwalloc_write_proc(cthwalloc-write-proc-badwidgets7 "widgets=2,widgets=2" + CTEST_PROCESS_COUNT=1 + CTEST_PROCESS_0=widgets + CTEST_PROCESS_0_WIDGETS=id:0,slots:2 + ) + +run_cthwalloc_write_noproc(cthwalloc-write-noproc-good1) +run_cthwalloc_write_noproc(cthwalloc-write-noproc-count + CTEST_PROCESS_COUNT=1 + ) + +run_cthwalloc_verify(cthwalloc-verify-good1 "test1;test2") +run_cthwalloc_verify(cthwalloc-verify-good2 "") +run_cthwalloc_verify(cthwalloc-verify-nolog "") +run_cthwalloc_verify(cthwalloc-verify-nores "") +run_cthwalloc_verify(cthwalloc-verify-noid "") +run_cthwalloc_verify(cthwalloc-verify-notenough "") +run_cthwalloc_verify(cthwalloc-verify-baddealloc "") +run_cthwalloc_verify(cthwalloc-verify-leak "") +run_cthwalloc_verify(cthwalloc-verify-badtest1 "") +run_cthwalloc_verify(cthwalloc-verify-badtest2 "test1") +run_cthwalloc_verify(cthwalloc-verify-badtest3 "test1") +run_cthwalloc_verify(cthwalloc-verify-badtest4 "test1") +run_cthwalloc_verify(cthwalloc-verify-badtest5 "test1") +run_cthwalloc_verify(cthwalloc-verify-nobegin "test1") +run_cthwalloc_verify(cthwalloc-verify-noend "test1") diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log new file mode 100644 index 0000000..abd6bad --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-baddealloc.log @@ -0,0 +1,2 @@ +alloc widgets 0 1 +dealloc widgets 0 2 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log new file mode 100644 index 0000000..605104b --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest1.log @@ -0,0 +1 @@ +begin test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log new file mode 100644 index 0000000..1ff1b0d --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest2.log @@ -0,0 +1,2 @@ +begin test1 +begin test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log new file mode 100644 index 0000000..1925e6a --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest3.log @@ -0,0 +1,3 @@ +begin test1 +end test1 +begin test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log new file mode 100644 index 0000000..3fe7da1 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest4.log @@ -0,0 +1,3 @@ +begin test1 +end test1 +end test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log new file mode 100644 index 0000000..3a2e7e3 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-badtest5.log @@ -0,0 +1 @@ +end test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log new file mode 100644 index 0000000..2cca0c3 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good1.log @@ -0,0 +1,14 @@ +begin test1 +alloc widgets 3 4 +alloc widgets 4 1 +alloc transmogrifiers calvin 2 +alloc fluxcapacitors outatime 121 +begin test2 +alloc widgets 3 4 +dealloc widgets 3 4 +dealloc widgets 4 1 +dealloc transmogrifiers calvin 2 +dealloc fluxcapacitors outatime 121 +end test1 +dealloc widgets 3 4 +end test2 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-good2.log diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log new file mode 100644 index 0000000..b900d86 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-leak.log @@ -0,0 +1 @@ +alloc widgets 0 1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nobegin.log diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log new file mode 100644 index 0000000..605104b --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noend.log @@ -0,0 +1 @@ +begin test1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log new file mode 100644 index 0000000..c718975 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-noid.log @@ -0,0 +1,2 @@ +alloc fluxcapacitors train 1 +dealloc fluxcapacitors train 1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nolog-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log new file mode 100644 index 0000000..a18202b --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-nores.log @@ -0,0 +1,2 @@ +alloc gpus 0 1 +dealloc gpus 0 1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log new file mode 100644 index 0000000..ac78d5a --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-verify-notenough.log @@ -0,0 +1,2 @@ +alloc widgets 0 8 +dealloc widgets 0 8 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-noproc-count-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badcount-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badres-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-badwidgets7-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake new file mode 100644 index 0000000..949d2d7 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good1-check.cmake @@ -0,0 +1,20 @@ +cthwalloc_verify_log( +[[begin test1 +alloc widgets 0 1 +dealloc widgets 0 1 +end test1 +begin cthwalloc-write-proc-good1 +alloc transmogrifiers calvin 1 +alloc widgets 0 2 +alloc widgets 0 1 +alloc widgets 2 2 +alloc widgets 0 1 +alloc widgets 2 2 +dealloc transmogrifiers calvin 1 +dealloc widgets 0 2 +dealloc widgets 0 1 +dealloc widgets 2 2 +dealloc widgets 0 1 +dealloc widgets 2 2 +end cthwalloc-write-proc-good1 +]]) diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake new file mode 100644 index 0000000..ca0c6b8 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-good2-check.cmake @@ -0,0 +1,6 @@ +cthwalloc_verify_log( +[[begin cthwalloc-write-proc-good2 +alloc widgets 3 8 +dealloc widgets 3 8 +end cthwalloc-write-proc-good2 +]]) diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nocount-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nores-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/cthwalloc-write-proc-nowidgets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestHardwareAllocation/hwspec.json b/Tests/RunCMake/CTestHardwareAllocation/hwspec.json new file mode 100644 index 0000000..bf8daf6 --- /dev/null +++ b/Tests/RunCMake/CTestHardwareAllocation/hwspec.json @@ -0,0 +1,56 @@ +{ + "local": [ + { + "widgets": [ + { + "id": "0", + "capacity": 4 + }, + { + "id": "1", + "capacity": 2 + }, + { + "id": "2", + "capacity": 4 + }, + { + "id": "3", + "capacity": 8 + }, + { + "id": "4", + "capacity": 1 + }, + { + "id": "5", + "capacity": 1 + }, + { + "id": "6", + "capacity": 1 + }, + { + "id": "7", + "capacity": 1 + } + ], + "transmogrifiers": [ + { + "id": "calvin", + "capacity": 2 + }, + { + "id": "hobbes", + "capacity": 2 + } + ], + "fluxcapacitors": [ + { + "id": "outatime", + "capacity": 121 + } + ] + } + ] +} |