summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2015-08-07 19:42:23 +0200
committerAlexis Hildebrandt <afh@surryhill.net>2015-08-07 19:42:23 +0200
commitfe410fa23971f1684c713ed2b6c5b17019161d7d (patch)
treeb8db46130276846e66f2d26c34491dcc65fb8051 /test
parent3c2d228ddc74b75122b07a87bbd06263092a9661 (diff)
downloadfork-ledger-fe410fa23971f1684c713ed2b6c5b17019161d7d.tar.gz
fork-ledger-fe410fa23971f1684c713ed2b6c5b17019161d7d.tar.bz2
fork-ledger-fe410fa23971f1684c713ed2b6c5b17019161d7d.zip
[tests] Set timezone for running tests
so that the tests run with a consistent environment.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt9
-rw-r--r--test/regress/1057.test2
-rw-r--r--test/unit/CMakeLists.txt2
3 files changed, 11 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0e7d5f2c..d0b62f6e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -25,6 +25,8 @@ macro(add_ledger_harness_tests _class)
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/RegressTests.py
$<TARGET_FILE:ledger> ${PROJECT_SOURCE_DIR}
${TestFile} ${TEST_PYTHON_FLAGS})
+ set_tests_properties(${_class}Test_${TestFile_Name}
+ PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
set_target_properties(check
PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
endif()
@@ -44,7 +46,10 @@ if (PYTHONINTERP_FOUND)
add_test(NAME ${_class}Test_${TestFile_Name}
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/${_class}.py
--ledger $<TARGET_FILE:ledger> --file ${TestFile})
- set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
+ set_tests_properties(${_class}Test_${TestFile_Name}
+ PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
+ set_target_properties(check
+ PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
endforeach()
# CheckManpage and CheckTexinfo are disabled, since they do not work
@@ -54,6 +59,8 @@ if (PYTHONINTERP_FOUND)
add_test(NAME ${_class}
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/${_class}.py
--ledger $<TARGET_FILE:ledger> --source ${PROJECT_SOURCE_DIR})
+ set_tests_properties(${_class}
+ PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
endforeach()
endif()
diff --git a/test/regress/1057.test b/test/regress/1057.test
index 94d82767..1cd91ee7 100644
--- a/test/regress/1057.test
+++ b/test/regress/1057.test
@@ -4,7 +4,7 @@
* Passif:Crédit:BanqueAccord -171,63 €
test -f test/regress/1057.test --now=2014/06/27 emacs
-(("$sourcepath/test/regress/1057.test" 1 (21308 34912 0) nil "www.amazon.fr"
+(("$sourcepath/test/regress/1057.test" 1 (21308 60112 0) nil "www.amazon.fr"
(2 "Dépense:Loisir:Ordi:Matériel" "101,50 €" nil " disque dur portable 2,5\" 2000 Go")
(3 "Dépense:Maison:Service:Poste" "70,13 €" nil)
(4 "Passif:Crédit:BanqueAccord" "-171,63 €" t)))
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index de7fdd26..4f688755 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -1,6 +1,8 @@
macro(add_ledger_test _name)
target_link_libraries(${_name} libledger)
add_test(Ledger${_name} ${PROJECT_BINARY_DIR}/${_name})
+ set_tests_properties(Ledger${_name}
+ PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
endmacro(add_ledger_test _name)
include_directories(${PROJECT_SOURCE_DIR}/src)