Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'algorithm': 0.04; 'compiler': 0.07; "subject:' ": 0.07; '"c"': 0.09; 'answering': 0.09; 'from:addr:mark': 0.09; 'wrapper': 0.09; 'python': 0.11; 'gui': 0.12; "'c'": 0.16; 'code?': 0.16; 'hazard': 0.16; 'invoking': 0.16; 'received:76.96': 0.16; 'received:mail.comcast.net': 0.16; 'rs232': 0.16; 'subject:program': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'library': 0.18; 'all,': 0.19; 'module': 0.19; 'trying': 0.19; 'everyone,': 0.19; "python's": 0.19; 'header:User-Agent:1': 0.23; 'received:comcast.net': 0.24; 'test.': 0.24; 'environment': 0.24; 'question': 0.24; 'appreciated': 0.26; 'logging': 0.26; 'task': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'specifically': 0.29; 'testing': 0.29; 'correct': 0.29; 'appreciated.': 0.29; 'am,': 0.29; 'ease': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'easier': 0.31; 'python).': 0.31; 'up.': 0.33; 'guess': 0.33; "i'd": 0.34; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'functions.': 0.36; 'returning': 0.36; 'thanks': 0.36; 'unit': 0.37; 'received:76': 0.38; 'question,': 0.38; 'to:addr:python- list': 0.38; 'embedded': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'easy': 0.60; 'results.': 0.60; 'john': 0.61; 'first': 0.61; 'myself': 0.63; 'different': 0.65; 'friendly': 0.72; 'gcc?': 0.84; 'controller': 0.91; 'offerings': 0.91; 'pc.': 0.93 Date: Fri, 08 Nov 2013 09:39:21 -0500 From: Mark Barton User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Talking to a 'C' program References: <89D0AF8F-FE2A-4051-84E7-7373A7340C35@o2.co.uk> In-Reply-To: <89D0AF8F-FE2A-4051-84E7-7373A7340C35@o2.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1383921561; bh=nH8lwXaaT4H9j1uFFOoJxNwQwc/JUaPQfdePz66grvg=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=S0XV9uffIgv/4zq3I+7G2WIZFVAJu/Wsw8RUO0DV12bmoRofztHFcphFhchgjmv+t oxM0RTMwa9VldJsEBORSLGOPhMMTgM6iRRmVxuFc84utmwmquw1YS3+Vc2O2z2CV42 +SuXlXZmo21S1NZEcRSxK+2fDoaBex31eNK9Jp7FfoSp3sJYcOjSMFWDV9NWBVuNY1 a1ZO78qjQzPtqee3g3bwbA/5Zgtw1MD1iESo9mZgKBsJWnjYw79AZvyLoN6Nlyeyzx 8MP7zdQcAINg7m2vAI6yS7eZ4C7jFdT6tRbalYjKTrTucZ1ldDcl517VdVI5QlelbN Pito3/Oa0bXsw== X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383921725 news.xs4all.nl 15956 [2001:888:2000:d::a6]:41101 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58798 On 11/8/13 9:23 AM, John Pote wrote: > Hi all, > > I have the task of testing some embedded 'C' code for a small micro-controller. Thought it would be a good idea to test it on the PC first to make sure the algorithm is correct then perhaps test it on the controller via RS232 and an appropriate wrapper round the 'C' functions. > > On the PC I can use Python's unit test library module and logging to create a nice and easy to use environment (I like Python). So my question is how to communicate from Python to the C module on the PC. What I'd like is simplicity and ease of setting up. All I can think of myself is to use sockets. > > Any ideas on how to do this would be gratefully appreciated. > > Also as I don't have any microsoft offerings of a C compiler any suggestions as to a suitable C compiler for a PC appreciated as well. llvm? mingw? gcc? > > Thanks a lot everyone, > John Hi John, I know this is not answering you question, but have you considered using one of the many "C" unit test programs that are available for testing the embedded code? I would hazard to guess that it would be much easier to use something that is specifically C friendly that trying to adapt Python unit test. You can however still use Python as a wrapper or even a slick GUI for invoking the C unit test using a subprocess and getting the results. I have used CUnit in the past and I know that it has several different methods for returning the results. I'm sure other C unit test programs are similar. Mark