[{"data":1,"prerenderedAt":224},["ShallowReactive",2],{"project-10147873":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":38,"post_text":29,"what":39,"said":73,"maker_in_thread":144,"shape":151,"grid":154,"attempts":180,"same_week":188,"maker_shows":34,"maker_hidden":217,"reader_version":218,"card":219},"10147873","Criterion","Writing modern C unit tests with Criterion","title","Show HN: Writing modern C unit tests with Criterion","https:\u002F\u002Fgithub.com\u002FSnaipe\u002FCriterion","github.com","Snaipe",1441041470,2015,34,13,824,2565,33,"shown","dev_tools","unit testing framework","library",[24,25,26,27],"c unit testing","c test framework","unit tests c","criterion c","quiet",null,{"positive":31,"neutral":32,"mixed":31,"critical":33},0,2,1,3,{"idea":36,"design":37},{"positive":31,"critical":31},{"positive":31,"critical":33},[31,31,31,31,31,31,31,34,31,34,31,33,31],{"problem":40,"audience":47,"pricing":29,"motivation":56,"time_to_build":60,"stack":64,"openness":71,"stage":71,"team_size":72},{"value":41,"source":42,"evidence":43},"Existing C test frameworks like CUnit and Check are frustrating to use","maker",[44],{"id":45,"by":11,"text":46},"10147887","Developer here. I made this unit testing framework out of frustrations I had (and still have) with other C frameworks like CUnit or Check. I wanted to make something much more…",{"value":48,"source":49,"evidence":50},"C developers writing unit tests","inferred",[51,52],{"id":45,"by":11,"text":46},{"id":53,"by":54,"text":55},"10152436","GFK_of_xmaspast","I'm having a little trouble imagining a situation where unit tests for a C codebase are appropriate that would be stymied by having to write the tests in C++. (Maybe relying on…",{"value":57,"source":42,"evidence":58},"Frustration with existing C testing frameworks",[59],{"id":45,"by":11,"text":46},{"value":61,"source":42,"evidence":62},"A few months of work",[63],{"id":45,"by":11,"text":46},[65],{"value":66,"source":42,"evidence":67},"C",[68],{"id":69,"by":11,"text":70},"10152091","Google Test requires you to write your tests in C++ rather than C; so there was times I just could not use it.","unknown","solo",{"praise":74,"objections":82,"requests":100,"questions":112,"alternatives":120},[75],{"value":76,"source":77,"evidence":78},"Good, well-made project","commenter",[79],{"id":80,"by":11,"text":81},"10149620","Actually, I didn't know about it until now! The project uses a similar approach to mine, by parsing the DIE tree produced by dwarf, which means that it won't work if you're not…",[83,89,96],{"value":84,"source":42,"evidence":85},"Cannot yet test exit codes or redirect stdout\u002Fstderr",[86],{"id":87,"by":11,"text":88},"10149646","By default, if the test raises any signal or exits with anything other than 0, the test fails. Otherwise, you can't (yet!) test if the code exits with a specific value nor simply…",{"value":90,"source":77,"evidence":91},"Code is opaque macro-heavy",[92],{"id":93,"by":94,"text":95},"10150429","some_online_guy","This looks like some good stuff, but browsing through your code, it's honestly pretty opaque macro hell. Why so obfuscated?",{"value":97,"source":42,"evidence":98},"Does not support Windows or OS X",[99],{"id":80,"by":11,"text":81},[101,108],{"value":102,"source":77,"evidence":103},"Test stdout and stderr output",[104],{"id":105,"by":106,"text":107},"10149573","lsiebert","personally I use Glib test (https:\u002F\u002Fdeveloper.gnome.org\u002Fglib\u002Fstable\u002Fglib-Testing.html) for c testing, but I'll check this out. Does this let you test what a program sends to…",{"value":109,"source":77,"evidence":110},"Test specific exit codes",[111],{"id":105,"by":106,"text":107},[113],{"value":114,"source":77,"evidence":115},"Why not use Google Test",[116],{"id":117,"by":118,"text":119},"10151707","workbin","Why did you rule out using Google Test (https:\u002F\u002Fcode.google.com\u002Fp\u002Fgoogletest)? (In case you mulled over using it.)",[121,128,132,136,140],{"value":122,"source":77,"evidence":123},"Novaprova",[124],{"id":125,"by":126,"text":127},"10149568","__d","Did you check out Greg Banks' Novaprova?",{"value":129,"source":77,"evidence":130},"Google Test",[131],{"id":117,"by":118,"text":119},{"value":133,"source":77,"evidence":134},"GLib testing",[135],{"id":105,"by":106,"text":107},{"value":137,"source":42,"evidence":138},"CUnit",[139],{"id":45,"by":11,"text":46},{"value":141,"source":42,"evidence":142},"Check",[143],{"id":45,"by":11,"text":46},{"comments":145,"answered":146,"key":147},6,5,[148,149,150],{"id":45,"text":46},{"id":80,"text":81},{"id":69,"text":70},{"commenters":152,"max_depth":146,"maker_replies":145,"first_comment_mins":34,"lifespan_hours":153},7,38,[155,157,159,161,163,166,167,169,170,172,173,175,177],[45,31,31,156,11,33],"project\u002Fpositive\u002Fidea",[125,31,31,158,126,31],"commenter\u002Fneutral\u002Fnone",[80,31,31,160,11,33],"project\u002Fmixed\u002Fperformance",[162,31,31,158,126,31],"10149636",[164,31,31,158,165,31],"10157802","gregnbanks",[117,31,31,158,118,31],[69,31,31,168,11,33],"project\u002Fneutral\u002Fidea",[53,31,34,168,54,31],[171,31,31,168,11,33],"10152818",[105,33,34,168,106,31],[87,33,31,174,11,33],"project\u002Fneutral\u002Fexecution",[93,32,33,176,94,31],"project\u002Fcritical\u002Fdesign",[178,32,31,179,11,33],"10152106","project\u002Fneutral\u002Fdesign",[181,184,187],{"id":182,"t":183,"points":32,"comments":33},"9033506",1423669982,{"id":185,"t":186,"points":32,"comments":33},"9107912",1424884391,{"id":4,"t":12,"points":14,"comments":15},[189,194,199,203,208,213],{"id":190,"name":191,"points":192,"category":193},"10129137","Flarum",163,"web_saas",{"id":195,"name":196,"points":197,"category":198},"10143341","TubeNearYou",102,"consumer_social",{"id":200,"name":201,"points":202,"category":20},"10133832","Forms",82,{"id":204,"name":205,"points":206,"category":207},"10159039","Javvy",77,"learning_science",{"id":209,"name":210,"points":211,"category":212},"10162121","instapainting.com",75,"ai",{"id":214,"name":215,"points":216,"category":193},"10145992","Hitcount.me",67,false,"v2",{"id":220,"name":5,"line":6,"ai":217,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":221,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":222,"url":9,"mix":223,"praise":76,"objection":84,"sub":21},10147873,[24,25,26,27],"0000000303010",[31,32,31,33],1794036535030]