remove version in all files
[dpdk.git] / scripts / test-framework.sh
1 #!/bin/sh
2
3 #   BSD LICENSE
4
5 #   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
6 #   All rights reserved.
7
8 #   Redistribution and use in source and binary forms, with or without 
9 #   modification, are permitted provided that the following conditions 
10 #   are met:
11
12 #     * Redistributions of source code must retain the above copyright 
13 #       notice, this list of conditions and the following disclaimer.
14 #     * Redistributions in binary form must reproduce the above copyright 
15 #       notice, this list of conditions and the following disclaimer in 
16 #       the documentation and/or other materials provided with the 
17 #       distribution.
18 #     * Neither the name of Intel Corporation nor the names of its 
19 #       contributors may be used to endorse or promote products derived 
20 #       from this software without specific prior written permission.
21
22 #   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
23 #   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
24 #   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
25 #   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
26 #   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
27 #   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
28 #   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
29 #   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
30 #   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
31 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
32 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34
35 # script to check that dependancies are working in the framework
36 # must be executed from root
37
38 # do a first build
39 make config T=x86_64-default-linuxapp-gcc O=deptest
40 make -j8 O=deptest
41
42 MOD_APP_TEST1=`stat deptest/app/test | grep Modify`
43 MOD_APP_TEST_MEMPOOL1=`stat deptest/build/app/test/test_mempool.o | grep Modify`
44 MOD_LIB_MEMPOOL1=`stat deptest/lib/librte_mempool.a | grep Modify`
45 MOD_LIB_MBUF1=`stat deptest/lib/librte_mbuf.a | grep Modify`
46
47 echo "----- touch mempool.c, and check that deps are updated"
48 sleep 1
49 touch lib/librte_mempool/rte_mempool.c
50 make -j8 O=deptest
51
52 MOD_APP_TEST2=`stat deptest/app/test | grep Modify`
53 MOD_APP_TEST_MEMPOOL2=`stat deptest/build/app/test/test_mempool.o | grep Modify`
54 MOD_LIB_MEMPOOL2=`stat deptest/lib/librte_mempool.a | grep Modify`
55 MOD_LIB_MBUF2=`stat deptest/lib/librte_mbuf.a | grep Modify`
56
57 if [ "${MOD_APP_TEST1}" = "${MOD_APP_TEST2}" ]; then
58         echo ${MOD_APP_TEST1} / ${MOD_APP_TEST2}
59         echo "Bad deps on deptest/app/test"
60         exit 1
61 fi
62 if [ "${MOD_APP_TEST_MEMPOOL1}" != "${MOD_APP_TEST_MEMPOOL2}" ]; then
63         echo "Bad deps on deptest/build/app/test/test_mempool.o"
64         exit 1
65 fi
66 if [ "${MOD_LIB_MEMPOOL1}" = "${MOD_LIB_MEMPOOL2}" ]; then
67         echo "Bad deps on deptest/lib/librte_mempool.a"
68         exit 1
69 fi
70 if [ "${MOD_LIB_MBUF1}" != "${MOD_LIB_MBUF2}" ]; then
71         echo "Bad deps on deptest/lib/librte_mbuf.a"
72         exit 1
73 fi
74
75 echo "----- touch mempool.h, and check that deps are updated"
76 sleep 1
77 touch lib/librte_mempool/rte_mempool.h
78 make -j8 O=deptest
79
80 MOD_APP_TEST3=`stat deptest/app/test | grep Modify`
81 MOD_APP_TEST_MEMPOOL3=`stat deptest/build/app/test/test_mempool.o | grep Modify`
82 MOD_LIB_MEMPOOL3=`stat deptest/lib/librte_mempool.a | grep Modify`
83 MOD_LIB_MBUF3=`stat deptest/lib/librte_mbuf.a | grep Modify`
84
85 if [ "${MOD_APP_TEST2}" = "${MOD_APP_TEST3}" ]; then
86         echo "Bad deps on deptest/app/test"
87         exit 1
88 fi
89 if [ "${MOD_APP_TEST_MEMPOOL2}" = "${MOD_APP_TEST_MEMPOOL3}" ]; then
90         echo "Bad deps on deptest/build/app/test/test_mempool.o"
91         exit 1
92 fi
93 if [ "${MOD_LIB_MEMPOOL2}" = "${MOD_LIB_MEMPOOL3}" ]; then
94         echo "Bad deps on deptest/lib/librte_mempool.a"
95         exit 1
96 fi
97 if [ "${MOD_LIB_MBUF2}" = "${MOD_LIB_MBUF3}" ]; then
98         echo "Bad deps on deptest/lib/librte_mbuf.a"
99         exit 1
100 fi
101
102
103 echo "----- change mempool.c's CFLAGS, and check that deps are updated"
104 sleep 1
105 make -j8 O=deptest CFLAGS_rte_mempool.o="-DDUMMY_TEST"
106
107 MOD_APP_TEST4=`stat deptest/app/test | grep Modify`
108 MOD_APP_TEST_MEMPOOL4=`stat deptest/build/app/test/test_mempool.o | grep Modify`
109 MOD_LIB_MEMPOOL4=`stat deptest/lib/librte_mempool.a | grep Modify`
110 MOD_LIB_MBUF4=`stat deptest/lib/librte_mbuf.a | grep Modify`
111
112 if [ "${MOD_APP_TEST3}" = "${MOD_APP_TEST4}" ]; then
113         echo "Bad deps on deptest/app/test"
114         exit 1
115 fi
116 if [ "${MOD_APP_TEST_MEMPOOL3}" != "${MOD_APP_TEST_MEMPOOL4}" ]; then
117         echo "Bad deps on deptest/build/app/test/test_mempool.o"
118         exit 1
119 fi
120 if [ "${MOD_LIB_MEMPOOL3}" = "${MOD_LIB_MEMPOOL4}" ]; then
121         echo "Bad deps on deptest/lib/librte_mempool.a"
122         exit 1
123 fi
124 if [ "${MOD_LIB_MBUF3}" != "${MOD_LIB_MBUF4}" ]; then
125         echo "Bad deps on deptest/lib/librte_mbuf.a"
126         exit 1
127 fi
128
129
130 echo "----- Deps check ok"
131 rm -rf deptest
132 exit 0