This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
forked from bemk/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-test-Work-on-test-file.patch
106 lines (91 loc) · 3.38 KB
/
0001-test-Work-on-test-file.patch
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From f8a606fd06953e8d822b9f403d42d15a93842f34 Mon Sep 17 00:00:00 2001
From: Bart Kuivenhoven <[email protected]>
Date: Fri, 16 Aug 2013 10:01:42 +0200
Subject: [PATCH] test: Work on test file
By running the test script with the flag "auto" it will now run without
demanding any input, which is ideal for automated testing environments.
Also another test case has been added to test out the random
configuration options, made possible by build.
Signed-off-by: Bart Kuivenhoven <[email protected]>
---
buildhelper.sh | 2 +-
src/main/resources/version.properties | 2 +-
test.sh | 28 +++++++++++++++++++++-------
3 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/buildhelper.sh b/buildhelper.sh
index c67009f..cdbda9a 100755
--- a/buildhelper.sh
+++ b/buildhelper.sh
@@ -10,7 +10,7 @@ echo "Creating the binary..."
cat <(echo -e "#!/bin/sh\nMYSELF=\`which \"\$0\" 2>/dev/null\`\n[ \$? -gt 0 -a -f \"\$0\" ] && MYSELF=\"./\$0\"\njava=java\nif test -n \"\$JAVA_HOME\"; then\n java=\"\$JAVA_HOME/bin/java\"\nfi\nexec \"\$java\" \$java_args -jar \$MYSELF \"\$@\"\nexit 1\n") ./target/build.jar > build
chmod +x ./build
-awk '{ if($1=="version.build") print $1 " " $2 " " ($3+1); else print $0; }' ./src/main/resources/version.properties > ./src/main/resources/version.properties.tmp && mv ./src/main/resources/version.properties.tmp ./src/main/resources/version.properties
+#awk '{ if($1=="version.build") print $1 " " $2 " " ($3+1); else print $0; }' ./src/main/resources/version.properties > ./src/main/resources/version.properties.tmp && mv ./src/main/resources/version.properties.tmp ./src/main/resources/version.properties
echo "Creating debian package..."
diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties
index 3680d14..5f2bd1d 100644
--- a/src/main/resources/version.properties
+++ b/src/main/resources/version.properties
@@ -1,3 +1,3 @@
version.major = 0
version.minor = 2
-version.build = 4
+version.build = 5
diff --git a/test.sh b/test.sh
index a5e217a..917493d 100755
--- a/test.sh
+++ b/test.sh
@@ -9,21 +9,29 @@ function clean()
$BUILD_DIR/build -c --config $PROJECT.config $PROJECT.build
}
-function test1()
+function test_no()
{
echo "Compiling test project with all flags NO"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure --allno-config
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build -t random
}
-function test2()
+function test_yes()
{
echo "Compiling test project with all flags YES"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure --allyes-config
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build -t random
}
-function test3()
+function test_random()
+{
+ echo "Compiling test project with random flags"
+ $BUILD_DIR/build --config $PROJECT.config $PROJECT.build --random-config
+ $BUILD_DIR/build --config $PROJECT.config $PROJECT.build
+
+}
+
+function test_user()
{
echo "Compiling test project with user defined flags"
$BUILD_DIR/build --config $PROJECT.config $PROJECT.build --configure
@@ -35,15 +43,21 @@ echo "Testing build..."
cd $TEST_DIR
echo " ** Test 1:"
-test1
+test_no
clean
echo " ** Test 2:"
-test2
+test_yes
+clean
+
+echo " ** Test: 3"
+test_random
clean
-echo " ** Test 3:"
-test3
+if [ "$1" != "auto" ]; then
+echo " ** Test 4:"
+test_user
clean
+fi
cd $BUILD_DIR
--
1.8.3.2