~ubuntu-branches/ubuntu/natty/gnome-keyring/natty

« back to all changes in this revision

Viewing changes to tests/prep-gtest.sh

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-02-16 19:00:06 UTC
  • mfrom: (1.1.58 upstream)
  • Revision ID: james.westby@ubuntu.com-20100216190006-cqpnic4zxlkmmi0o
Tags: 2.29.90git20100218-0ubuntu1
Updated to a git snapshot version

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                sed -ne 's/.*DEFINE_TEST[       ]*(\([^)]\+\))/DECLARE_TEST(\1);/p' $_file
34
34
                sed -ne 's/.*DEFINE_START[      ]*(\([^)]\+\))/DECLARE_START(\1);/p' $_file
35
35
                sed -ne 's/.*DEFINE_STOP[       ]*(\([^)]\+\))/DECLARE_STOP(\1);/p' $_file
 
36
                sed -ne 's/.*DEFINE_EXTERNAL[   ]*(\([^)]\+\))/DECLARE_EXTERNAL(\1);/p' $_file
36
37
        done
37
38
        echo
38
39
}
83
84
                sed -ne "s/.*DEFINE_TEST(\([^)]\+\)).*/ g_test_add(\"\/$_name\/\1\", int, NULL, $_setup, test_\1, $_teardown);/p" $_file
84
85
                
85
86
        done
86
 
        
87
 
        echo "}"
88
 
        echo
89
 
                
 
87
        echo "}"
 
88
        echo
 
89
 
 
90
        # External function
 
91
        echo "static void run_externals (void) {"
 
92
        for _file in $@; do
 
93
                sed -ne "s/.*DEFINE_EXTERNAL(\([^)]\+\)).*/     test_external_run (\"\1\", external_\1);/p" $_file
 
94
        done
 
95
        echo "}"
 
96
        echo
 
97
 
 
98
        echo "static int run(void) {"
 
99
        echo "  int ret;"
 
100
        echo "  initialize_tests ();"
 
101
        echo "  start_tests ();"
 
102
        echo "  ret = g_test_run ();"
 
103
        echo "  run_externals ();"
 
104
        echo "  stop_tests();"
 
105
        echo "  return ret;"
 
106
        echo "}"
 
107
 
90
108
        echo "#include \"tests/gtest-helpers.c\""
91
109
}
92
110