Revert "Add unfinished test scripts included in version 2.103"
This reverts commit cab4c9169782171da34ca2acb9132630e391d21c.
Ben Hutchings
3 years ago
0 | #!/bin/sh -eu | |
1 | ||
2 | datadir="debian/tests/copy-modules-data" | |
3 | moddir="$AUTOPKGTEST_TMP/modules" | |
4 | ||
5 | ## Create dummy module files and modules.builtin | |
6 | #while read -r filename; do | |
7 | # mkdir -p "$moddir/$(dirname "$filename")" | |
8 | # touch "$moddir/$filename" | |
9 | #done < "$datadir/filelist" | |
10 | #cp "$datadir/modules.builtin" "$moddir/" | |
11 | ||
12 | my_rc=0 | |
13 | ||
14 | export KW_DEFCONFIG_DIR="$PWD/$datadir" | |
15 | ||
16 | export SOURCEDIR=$datadir/foo | |
17 | export KW_DEFCONFIG_DIR=debian/installer | |
18 | KW_CONFIG_DIR=debian/installer/amd64 | |
19 | ||
20 | version=3.14-2 | |
21 | flavor=amd64 | |
22 | installedname=1.23-0-amd64 | |
23 | ||
24 | bash -x commands/copy-modules $version $flavor $installedname | |
25 | exit | |
26 | ||
27 | for input in "$datadir"/*.in; do | |
28 | name="$(basename "${input%.in}")" | |
29 | echo "I: Testing preprocess case $name" | |
30 | ||
31 | output="$AUTOPKGTEST_TMP/$name.out" | |
32 | error="$AUTOPKGTEST_TMP/$name.err" | |
33 | rc=0; commands/preprocess "$input" "$moddir" >"$output" 2>"$error" || rc=$? | |
34 | ||
35 | # Replace source locations in error messages, so expected error | |
36 | # messages don't need to be updated for every change of line no. | |
37 | sed -i 's/at [^ ]* line [0-9]*/at SOMEWHERE/' "$error" | |
38 | ||
39 | # Find expected output, error messages and exit code | |
40 | exp_output="$datadir/$name.out" | |
41 | if [ -f "$datadir/$name.err" ]; then | |
42 | exp_error="$datadir/$name.err" | |
43 | else | |
44 | exp_error=/dev/null | |
45 | fi | |
46 | if [ -f "$datadir/$name.rc" ]; then | |
47 | exp_rc="$(cat "$datadir/$name.rc")" | |
48 | else | |
49 | exp_rc=0 | |
50 | fi | |
51 | ||
52 | # Compare actual with expected | |
53 | if diff -q "$exp_output" "$output" && diff -q "$exp_error" "$error" \ | |
54 | && [ "$rc" = "$exp_rc" ]; then | |
55 | echo "I: pass" | |
56 | else | |
57 | diff -u "$exp_output" "$output" || true | |
58 | diff -u "$exp_error" "$error" || true | |
59 | echo "E: rc=$rc" | |
60 | my_rc=1 | |
61 | fi | |
62 | done | |
63 | ||
64 | exit "$my_rc" |
0 | #!/bin/sh -eu | |
1 | ||
2 | datadir="debian/tests/preprocess-data" | |
3 | moddir="$AUTOPKGTEST_TMP/modules" | |
4 | ||
5 | # Create dummy module files and modules.builtin | |
6 | while read -r filename; do | |
7 | mkdir -p "$moddir/$(dirname "$filename")" | |
8 | touch "$moddir/$filename" | |
9 | done < "$datadir/filelist" | |
10 | cp "$datadir/modules.builtin" "$moddir/" | |
11 | ||
12 | # Test for Debian Bug #?????? | |
13 | ln -sf $moddir ${moddir}.symlink | |
14 | moddir="${moddir}.symlink" | |
15 | ||
16 | my_rc=0 | |
17 | ||
18 | export KW_DEFCONFIG_DIR="$PWD/$datadir" | |
19 | for input in "$datadir"/*.in; do | |
20 | name="$(basename "${input%.in}")" | |
21 | echo "I: Testing preprocess case $name" | |
22 | ||
23 | output="$AUTOPKGTEST_TMP/$name.out" | |
24 | error="$AUTOPKGTEST_TMP/$name.err" | |
25 | rc=0; commands/preprocess "$input" "$moddir" >"$output" 2>"$error" || rc=$? | |
26 | ||
27 | # Replace source locations in error messages, so expected error | |
28 | # messages don't need to be updated for every change of line no. | |
29 | sed -i 's/at [^ ]* line [0-9]*/at SOMEWHERE/' "$error" | |
30 | ||
31 | # Find expected output, error messages and exit code | |
32 | exp_output="$datadir/$name.out" | |
33 | if [ -f "$datadir/$name.err" ]; then | |
34 | exp_error="$datadir/$name.err" | |
35 | else | |
36 | exp_error=/dev/null | |
37 | fi | |
38 | if [ -f "$datadir/$name.rc" ]; then | |
39 | exp_rc="$(cat "$datadir/$name.rc")" | |
40 | else | |
41 | exp_rc=0 | |
42 | fi | |
43 | ||
44 | # Compare actual with expected | |
45 | if diff -q "$exp_output" "$output" && diff -q "$exp_error" "$error" \ | |
46 | && [ "$rc" = "$exp_rc" ]; then | |
47 | echo "I: pass" | |
48 | else | |
49 | diff -u "$exp_output" "$output" || true | |
50 | diff -u "$exp_error" "$error" || true | |
51 | echo "E: rc=$rc" | |
52 | my_rc=1 | |
53 | fi | |
54 | done | |
55 | ||
56 | exit "$my_rc" |