Skip to content

Commit f75dcbd

Browse files
committed
travis has now multiple jobs
1 parent a769cca commit f75dcbd

9 files changed

+92
-84
lines changed

.travis.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: java
2-
matrix:
3-
include:
4-
- os: osx
5-
osx_image: xcode9
6-
- os: linux
7-
jdk: openjdk8
8-
- os: linux
9-
jdk: oraclejdk8
10-
sudo: true
11-
install: "./.travis_install.sh"
12-
script: "./.travis_run_tests.sh"
13-
after_success:
14-
- "./.travis_deploy.sh"
2+
3+
# we don't use sudo to go faster
4+
#sudo: true
5+
156
env:
167
global:
8+
# key for deploying automatically after each commit on master
179
secure: Iy9BF1undwwc3rNo9VikWuqdDqyBbGetG/IGVPBW2ciJEuZNwK76jB/DWfhP2pFxWaU3VDFlPUExAHc90R46MOj9PzhALwadKcWN+z4LWio4Pd4x4miejI7NK2rQfWMQacxIfw05zIt9nWvqNGjrEDg5J3hx3G0sa/eyhi5odZLt5AKNxqJTQNiVv1STZJSntssKhaweVqdnwg3/B1kXEvSyA6Em1/4DhcUEYSBpgvKTfV0+BeoISorEqsR+T3Nrqx48t0fDFzZwd/oMRAjD//loNHebwdxNhAmr+NXlMUXlqdGLgUYTPI+kF9ESgrY7mKkuN4WSc0d8Di3HuznvRvmStMX11OFnblY2OOjPPFEmk4eQW1N/t8oqqHNPpHDpTeHAPL3CLitP66R6d1H0y5megj6WiQeN9Y0lmtB6knUdG4Vmdj3M7aKHVgKGMvgRBfTqF9jQrRbGYxdmnBeq66VKKuxKINr2DQEsL4PzXdb/xBUz1DmAieUprc74ttp5K7uHFNrGOEhSYoHB0iCmSUUl3hAHJgdVKPNJK7LP2dqZwm5mVGEd+LTDCHHOzhxArD2c5CkzWRVFAbDS3r1ExueaC8jrLSrik0l/C82ih+uG247UMXq9RV+ch3ZB4/VYTN2cCTQ0HQIoHYaghW5UAFfwxcIpbnp0qs6y+XF76Qc=
10+
matrix:
11+
- SCRIPT="./.travis_core.sh"
12+
- SCRIPT="./.travis_server.sh"
13+
- SCRIPT="./.travis_intellij.sh"
14+
#- SCRIPT="./.travis_tse.sh"
15+
#- SCRIPT="./.travis_run_defects4j.sh"
16+
17+
script: $SCRIPT

.travis_core.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# script for Travis
3+
4+
echo "Compiling & testing Nopol"
5+
cd test-projects
6+
mvn clean package -DskipTests
7+
cd ..
8+
cd nopol
9+
mvn clean install jacoco:report coveralls:report
10+
if [[ $? != 0 ]]
11+
then
12+
exit 1
13+
fi
14+
cd ..
15+
16+
# automatic deployment to tdurieux's repo
17+
if [ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_JDK_VERSION == "openjdk8" ]; then
18+
cd nopol;
19+
mvn versions:set -DnewVersion=`git rev-parse HEAD`
20+
mvn deploy --settings ../.travis-settings.xml -DskipTests=true -B;
21+
fi

.travis_run_defects4j.sh .travis_defects4j.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ id=5
55
wd=${project}_${id}
66

77
cd nopol
8+
mvn clean install -DskipTests
89

910
git clone https://github.com/rjust/defects4j.git
1011
cd defects4j
@@ -13,9 +14,9 @@ cd ../
1314
defects4j/framework/bin/defects4j checkout -p ${project} -v ${id}b -w ${wd}
1415
cd ${wd}
1516
../defects4j/framework/bin/defects4j compile
16-
../defects4j/framework/bin/defects4j test | tee > out.txt
17+
../defects4j/framework/bin/defects4j test | tee > out-defects4j-test.txt
1718

18-
fullQualifiedNameFailingTestCase=$(cat out.txt | grep - | cut -d ":" -f1 | cut -d "-" -f2)
19+
fullQualifiedNameFailingTestCase=$(cat out-defects4j-test.txt | grep - | cut -d ":" -f1 | cut -d "-" -f2)
1920
echo ${fullQualifiedNameFailingTestCase}
2021

2122
cd ../

.travis_deploy.sh

-6
This file was deleted.

.travis_install.sh

-9
This file was deleted.

.travis_intellij.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# script for Travis
3+
4+
source /opt/jdk_switcher/jdk_switcher.sh
5+
jdk_switcher use oraclejdk8
6+
7+
8+
cd test-projects
9+
mvn clean install -DskipTests
10+
cd ..
11+
cd nopol
12+
mvn clean install -DskipTests
13+
cd ..
14+
cd nopol-server
15+
mvn clean install -DskipTests
16+
cd ..
17+
18+
19+
# IDE plugin
20+
echo "Compiling & testing nopol-ui-intellij"
21+
cd nopol-ui-intellij
22+
./gradlew buildPlugin
23+
if [[ $? != 0 ]]
24+
then
25+
exit 1
26+
fi
27+
cd ..
28+

.travis_run_tests.sh

-44
This file was deleted.

.travis_server.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# script for Travis
3+
4+
source /opt/jdk_switcher/jdk_switcher.sh
5+
jdk_switcher use oraclejdk8
6+
7+
echo "Compiling & testing Nopol"
8+
cd test-projects
9+
mvn clean install -DskipTests
10+
cd ..
11+
cd nopol
12+
mvn clean install -DskipTests
13+
cd ..
14+
15+
echo ${JAVA_HOME}
16+
17+
echo "Compiling & testing nopol server"
18+
cd nopol-server
19+
mvn clean install
20+
if [[ $? != 0 ]]
21+
then
22+
exit 1
23+
fi
24+
cd ..
25+

test-projects/src/test/java/nopol_examples/nopol_example_1/NopolExampleTest.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,55 @@
22

33
import static org.junit.Assert.assertEquals;
44

5+
import junit.framework.TestCase;
56
import org.junit.Test;
67

7-
public class NopolExampleTest {
8+
public class NopolExampleTest extends TestCase{
89

9-
@Test
1010
public void test1(){
1111
NopolExample ex = new NopolExample();
1212
assertEquals('a', ex.charAt("abcd", 0));
1313
}
1414

15-
@Test
1615
public void test2(){
1716
NopolExample ex = new NopolExample();
1817
assertEquals('d', ex.charAt("abcd", 3));
1918
}
2019

21-
@Test
2220
public void test3(){
2321
NopolExample ex = new NopolExample();
2422
String s = "abcd";
2523
assertEquals('d', ex.charAt(s, s.length()-1));
2624
}
2725

28-
@Test
2926
public void test4(){
3027
NopolExample ex = new NopolExample();
3128
String s = "abcd";
3229
assertEquals('d', ex.charAt(s, 12));
3330
}
3431

35-
@Test
3632
public void test5(){
3733
NopolExample ex = new NopolExample();
3834
String s = "abcd";
3935
assertEquals('a', ex.charAt(s, -5));
4036
}
4137

42-
@Test
4338
public void test6(){
4439
NopolExample ex = new NopolExample();
4540
String s = "abcd";
4641
assertEquals('a', ex.charAt(s, -1));
4742
}
4843

49-
@Test
5044
public void test7(){
5145
NopolExample ex = new NopolExample();
5246
assertEquals('c', ex.charAt("abcd", 2));
5347
}
5448

55-
@Test
5649
public void test8(){
5750
NopolExample ex = new NopolExample();
5851
assertEquals('b', ex.charAt("abcd", 1));
5952
}
6053

61-
@Test
6254
public void test9(){
6355
NopolExample ex = new NopolExample();
6456
assertEquals('f', ex.charAt("abcdefghijklm", 5));

0 commit comments

Comments
 (0)