title: Creating Fixtures in cmocka
body: <p>I'm working on a project that's <a href="https://cmocka.org/" rel="noreferrer">using the cmocka framework</a>.   The cmocka homepage states</p>
  
  <blockquote>
    <p>Test fixtures are setup and teardown functions that can be shared across multiple test cases to provide common functions that prepare the test environment and destroy it afterwards.</p>
  </blockquote>
  
  <p>However, none of the <a href="https://lwn.net/Articles/558106/" rel="noreferrer">docs</a> <a href="https://api.cmocka.org/index.html" rel="noreferrer">I've</a> <a href="https://api.cmocka.org/modules.html" rel="noreferrer">read</a> explain how the fixture system works. </p>
  
  <p>If I'm running my tests with code that looks like this </p>
  
  <pre><code>int main(void) {
    const struct CMUnitTest license_tests[] = {
        cmocka_unit_test(test_setup),                        
        cmocka_unit_test(test_null_app),      
        cmocka_unit_test(test_null_name),        
    };
  
    return cmocka_run_group_tests(license_tests, NULL, NULL);
  }
  </code></pre>
  
  <p>How/where can I instruct cmocka to run setup/tear down fixtures and what features (if any) does cmocka have for letting me access things created in said fixtures?</p>