Skip to content

Commit

Permalink
fix failing test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
gijzelaerr committed Nov 3, 2017
1 parent 43aa528 commit 8e43e2c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,31 @@ build
quick-der.kdev4
Testing
*.pyc

dist/
*.egg-info/
.venv*/
.virtualenv*/
*.so
*.dylib
.cache/
.eggs/

kxover.h
python/tests/kxover.h
python/tests/test01.h
python/tests/test01.py
python/tests/test01a.h
python/tests/test01a.py
python/tests/test02.h
python/tests/test02.py
python/tests/test04.h
python/tests/test04.py
test01.h
test01.py
test01a.h
test01a.py
test02.h
test02.py
test04.h
test04.py
10 changes: 5 additions & 5 deletions cmake/MacroASN1Module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# https://opensource.org/licenses/BSD-2-Clause
# SPDX short identifier: BSD-2-Clause

execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/python/quick_der)
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/python/testing)
set (_qd_aam_dir ${CMAKE_CURRENT_LIST_DIR})

find_program (_qd_asn2quickder
Expand All @@ -65,24 +65,24 @@ endif()

macro(add_asn1_module _modulename _groupname)
# Generate the module file in <quick-der/modulename.h>
# and python/quick_der/modulename.py
# and python/testing/modulename.py
# and install the header file to include/quick-der/modulename.h.
set(_ppath $ENV{PYTHONPATH})
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/quick-der/${_modulename}.h
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_SOURCE_DIR}/python:${_ppath} ${_qd_asn2quickder} -l c ${asn1module_asn2quickder_options} ${CMAKE_CURRENT_SOURCE_DIR}/${_modulename}.asn1
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_modulename}.asn1
WORKING_DIRECTORY quick-der
COMMENT "Build include file ${_modulename}.h from ASN.1 spec")
add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/python/quick_der/${_modulename}.py
add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/python/testing/${_modulename}.py
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_SOURCE_DIR}/python:${_ppath} ${_qd_asn2quickder} -l python ${asn1module_asn2quickder_options} ${CMAKE_CURRENT_SOURCE_DIR}/${_modulename}.asn1
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_modulename}.asn1
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python/quick_der
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python/testing
COMMENT "Build Python script ${_modulename}.py from ASN.1 spec")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/quick-der/${_modulename}.h DESTINATION include/quick-der)

add_custom_target(${_modulename}_asn1_h DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/quick-der/${_modulename}.h
${CMAKE_BINARY_DIR}/python/quick_der/${_modulename}.py
${CMAKE_BINARY_DIR}/python/testing/${_modulename}.py
)
add_dependencies(${_groupname} ${_module}_asn1_h)

Expand Down
4 changes: 2 additions & 2 deletions cmake/module-test.py.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import sys

sys.path = [ '@CMAKE_BINARY_DIR@/python/installroot' ] + sys.path
sys.path = [ '@CMAKE_BINARY_DIR@/python/testing' ] + sys.path

import quick_der.@ASN1_MODULE_NAME@
import @ASN1_MODULE_NAME@

sys.exit (0)

2 changes: 1 addition & 1 deletion python/tests/test_asn2quickder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ def test_test05(self):

def test_kxover(self):
asn1_path = path.join(here, '../../arpa2/kxover.asn1')
main('asn2quickder', ['-l', 'c', '-I', '../../rfc/', asn1_path])
main('asn2quickder', ['-l', 'c', '-I', path.join(here, '../../rfc/'), asn1_path])


0 comments on commit 8e43e2c

Please sign in to comment.