aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-execl.sh
blob: 134055be9f45f968de9558e543639c29f2b6a21f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#
# SPDX-License-Identifier: LGPL-2.1-only
#
cat > execl_test.c << EOF
#include <unistd.h>
int main() {
        return execl("/usr/bin/env", "/usr/bin/env", "A=A", "B=B", "C=C", NULL);
}
EOF

gcc -o execl_test execl_test.c

./execl_test | grep -q "C=C"

if [ "$?" = "0" ]
then
    #echo "Passed."
    rm -f execl_test execl_test.c
    exit 0
fi
#echo "Failed"
rm -f execl_test execl_test.c
exit 1