[issue24932] Migrate _testembed to a C unit testing library

2016-12-30 Thread Steve Dower

Steve Dower added the comment:

The only real advantage of adding a native unit testing framework here is to 
avoid having to start/destroy _testembed[.exe] multiple times during the test 
run. But given the nature of these tests is highly environmental, I don't think 
we can reasonably avoid it. I'm also highly doubtful that any framework is 
going to actually reduce the work we'd need to do to mock out initialization 
steps.

I've attached a patch that takes the first step towards making _testembed more 
usable, by changing main() to look up a test from a list and execute it, then 
return the exit code. The support in test_capi.EmbeddingTests is neat, so 
adding more tests here will be fairly straightforward.

--
keywords: +patch
nosy: +steve.dower
versions: +Python 3.7
Added file: http://bugs.python.org/file46093/24932_1.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24932] Migrate _testembed to a C unit testing library

2015-08-25 Thread Brett Cannon

Brett Cannon added the comment:

Someone is going to think of [googletest] 
(https://github.com/google/googletest) and then realize that it is a C++ test 
suite and thus won't work unless you explicitly compile Python for C++.

--
nosy: +brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24932
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24932] Migrate _testembed to a C unit testing library

2015-08-24 Thread Nick Coghlan

New submission from Nick Coghlan:

Programs/_testembed (invoked by test_capi to test CPython's embedding support) 
is currently a very simple application with only two different embedding tests: 
https://hg.python.org/cpython/file/tip/Programs/_testembed.c

In light of proposals like PEP 432 to change the interpreter startup sequence 
and make it more configurable, it seems desirable to be better able to test 
more configuration options directly, without relying on the abstraction layer 
provided by the main CPython executable.

The specific unit testing library that prompted this idea was cmocka, which is 
used by libssh, sssd and cwrap: https://cmocka.org/

cwrap in turn is used by the Samba team to mock out network interfaces and 
other operations using LD_PRELOAD: https://cwrap.org/

We don't necessarily have to use those particular libraries, I'm just filing 
this issue to capture the idea of improving our C level unit testing 
capabilities, and then updating regrtest to better capture and report those 
results (currently there are just a couple of tests in test_capi that call the 
_testembed executable)

--
components: Tests
messages: 249106
nosy: encukou, eric.snow, ncoghlan
priority: normal
severity: normal
status: open
title: Migrate _testembed to a C unit testing library
type: enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24932
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com