File: unittest_cmake.sh

package info (click to toggle)
qlcplus 4.14.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,644 kB
  • sloc: cpp: 182,867; javascript: 7,764; xml: 2,453; ansic: 2,120; sh: 1,716; python: 634; ruby: 606; makefile: 23
file content (42 lines) | stat: -rwxr-xr-x 1,264 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

# Define the source and destination directories
SOURCE_DIR="."
DEST_DIR="./build"
if [ -d "$2" ]; then
  DEST_DIR="$2"
fi

echo "Using the destination directory $DEST_DIR"

if [ ! -d $DEST_DIR/resources/ ]; then
  mkdir -p $DEST_DIR/resources/
fi

# Copy resources directories necessary for unittest
cp -r $SOURCE_DIR/resources/colorfilters $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/fixtures $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/gobos $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/icons $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/inputprofiles $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/rgbscripts $DEST_DIR/resources
cp -r $SOURCE_DIR/resources/schemas $DEST_DIR/resources

# Find all files necessary for tests recursively in the source directory and copy to destination directory
for file in $(find $SOURCE_DIR -path $DEST_DIR -prune -o \( -name "test.sh" -o -name "*.xml*" \)); do

    # Get the directory of the file (excluding the "./" prefix)
    dir=$(dirname ${file#./})

    # Create the destination directory if it doesn't exist
    mkdir -p $DEST_DIR/$dir

    # Move the file to the new destination
    cp $file $DEST_DIR/$dir/
done

cp $SOURCE_DIR/unittest.sh $DEST_DIR/

pushd $DEST_DIR
./unittest.sh $1
popd