-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Make dest dir creation failure be handled gracefully (#228)
I have a very strong test that ensures that a dest dir creation failure is handled gracefully.
- Loading branch information
1 parent
0bda3bd
commit 7a6f9aa
Showing
3 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/core/CTestScriptsUnitTests/TAATDriver/bad_dest_dir/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) | ||
SET(PROJECT_NAME TAATDriver) | ||
PROJECT(${PROJECT_NAME} NONE) | ||
|
||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/../CommonTAATDriverBoilerPlate.cmake) | ||
|
||
TRIBITS_ADD_ADVANCED_TEST( | ||
TAAT_COPY_FILES_TO_TEST_DIR_bad_dest_dir | ||
OVERALL_WORKING_DIRECTORY TEST_NAME | ||
TEST_0 CMND mkdir ARGS read_only_dir | ||
TEST_1 CMND chmod ARGS a-w read_only_dir | ||
TEST_2 COPY_FILES_TO_TEST_DIR test_file_b.txt # Good file | ||
SOURCE_DIR ${COPY_FILE_SOURCE_DIR} # Good source dir | ||
DEST_DIR read_only_dir/subdir # Can't create directory in read-only dir | ||
TEST_3 COPY_FILES_TO_TEST_DIR test_file_a.txt | ||
SOURCE_DIR ${COPY_FILE_SOURCE_DIR} | ||
DEST_DIR good_dest_dir | ||
TEST_4 CMND cat ARGS good_dest_dir/test_file_a.txt | ||
PASS_REGULAR_EXPRESSION "This is Test File A" | ||
) | ||
# NOTE: The above failing test is used to test that a bad dest dir is handled | ||
# gracefully and allows later commands to run and pass (but the overall test | ||
# will fail). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters