Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab1 updating Programs root directory #25

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added Circles/build.xml
Empty file.
1 change: 1 addition & 0 deletions Coverage/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/bin/
/target/
284 changes: 250 additions & 34 deletions Coverage/build.xml
Original file line number Diff line number Diff line change
@@ -1,76 +1,292 @@
<!-- Sample Ant build file for running IglooScore under JaCoCo -->
<!-- Jonathan Cook, 17 Sep 2015 -->
<project name="iglooscore" default="jacocoreport" xmlns:jacoco="antlib:org.jacoco.ant">
<project name="racingscore" default="report" xmlns:jacoco="antlib:org.jacoco.ant">

<!-- property to allow ant to find jacoco: CHANGE THE PATH to point to yours -->
<property name="jacocodir" location="/home/jcook/tools/jacoco/lib"/>
<property name="jacoco.dir" location="lib/"/>
<property name="src.dir" location="src/"/>
<property name="build.dir" location="bin/"/>
<property name="result.dir" location="./target"/>
<property name="result.report.dir" location="${result.dir}/site/jacoco"/>
<property name="result.exec.file" location="${result.dir}/jacoco.exec"/>

<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${jacocodir}/jacocoant.jar"/>
<classpath path="${jacoco.dir}/jacocoant.jar"/>
</taskdef>

<!-- standard compile task, but turn debugging on for source viewing -->
<target name="compile" description="compile the source">
<javac srcdir="." includeantruntime="false" debug="true"/>
<mkdir dir="${build.dir}" />
<javac srcdir="${src.dir}" destdir="${build.dir}" includeantruntime="false" debug="true"/>
</target>

<!-- tests if new jacoco run is needed by checking if the jacoco.exec file is
newer than the class files or this build file -->
<target name="checkRun">
<uptodate property="run.notneeded" targetfile="jacoco.exec">
<srcfiles dir="." includes="*.class build.xml" />
<uptodate property="run.notneeded" targetfile="${result.exec.file}">
<srcfiles dir="${src.dir}" includes="**/*.java build.xml" />
</uptodate>
</target>

<!-- run program under jacoco: this example has two runs, you'll need to perhaps
modify them, and then add more; this only runs if needed -->
<target name="jacocorun" depends="compile,checkRun" unless="run.notneeded">
<delete>
<!-- must delete coverage data file to start afresh (otherwise coverage accumulates) -->
<fileset dir="." includes="jacoco.exec"/>
</delete>
<echo message="TEST IglooScore1: 8 9 6"/>
<java classname="IglooScore1" fork="true">
<arg value="8"/><arg value="9"/><arg value="6"/>
<jvmarg line="-javaagent:${jacocodir}/jacocoagent.jar"/>
</java>
<echo message="TEST IglooScore2: 8 9 6"/>
<java classname="IglooScore2" fork="true">
<arg value="8"/><arg value="9"/><arg value="6"/>
<jvmarg line="-javaagent:${jacocodir}/jacocoagent.jar"/>
</java>
</target>
<target name="test" depends="compile,checkRun" unless="run.notneeded">
<echo>run needed...</echo>


<echo message="TEST RacingScore1: 8 9 6"/>
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore1" fork="true">
<classpath path = "${build.dir}" />
<arg value="8"/>
<arg value="9"/>
<arg value="6"/>
</java>
</jacoco:coverage>

<!-- tests if new jacoco report needs generated by checking if top report file
(index.html) is newer than the run data file (jacoco.exec) -->
<target name="checkReport">
<uptodate property="report.notneeded" targetfile="report/index.html" srcfile="jacoco.exec" />
<echo message="TEST RacingScore1: 50 9 6" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore1" fork="true">
<classpath path="${build.dir}" />
<arg value="50" />
<arg value="9" />
<arg value="6" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore1: 50 9 100" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore1" fork="true">
<classpath path="${build.dir}" />
<arg value="50" />
<arg value="9" />
<arg value="100" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore1: 8 9" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore1" fork="true">
<classpath path="${build.dir}" />
<arg value="8" />
<arg value="9" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore1: a b c" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore1" fork="true">
<classpath path="${build.dir}" />
<arg value="a" />
<arg value="b" />
<arg value="c" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 8 9 6"/>
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path ="${build.dir}" />
<arg value="8"/>
<arg value="9"/>
<arg value="6"/>
</java>
</jacoco:coverage>

<!-- racingscore2 tests start -->
<!-- if (score1 < score2 && score1 < score3) -->
<echo message="TEST RacingScore2: 1 9 6" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="1" />
<arg value="9" />
<arg value="6" />
</java>
</jacoco:coverage>

<!-- if (score1 < score2 && !score1 < score3) -->
<echo message="TEST RacingScore2: 5 6 4" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="5" />
<arg value="6" />
<arg value="4" />
</java>
</jacoco:coverage>

<!-- else if (score2 < score1 && score2 < score3) -->
<echo message="TEST RacingScore2: 8 1 6" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="8" />
<arg value="1" />
<arg value="6" />
</java>
</jacoco:coverage>

<!-- else if (!score2 < score1 && score2 < score3) -->
<echo message="TEST RacingScore2: 8 5 1" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="8" />
<arg value="5" />
<arg value="1" />
</java>
</jacoco:coverage>

<!-- else if (score3 < score1 && !score3 < score2) -->
<echo message="TEST RacingScore2: 10 9 9" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="10" />
<arg value="9" />
<arg value="9" />
</java>
</jacoco:coverage>

<!-- else -->
<echo message="TEST RacingScore2: 3 3 3" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="3" />
<arg value="3" />
<arg value="3" />
</java>
</jacoco:coverage>


<echo message="TEST RacingScore2: -1 -1 -1" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="-1" />
<arg value="-1" />
<arg value="-1" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 60 0 0" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="60" />
<arg value="0" />
<arg value="0" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 0 60 0" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="0" />
<arg value="60" />
<arg value="0" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 0 0 60" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="0" />
<arg value="0" />
<arg value="60" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: -1 0 0" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="-1" />
<arg value="0" />
<arg value="0" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 0 -1 0" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="0" />
<arg value="-1" />
<arg value="0" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 0 0 -1" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="0" />
<arg value="0" />
<arg value="-1" />
</java>
</jacoco:coverage>

<echo message="TEST RacingScore2: 1 2 3 4" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="1" />
<arg value="2" />
<arg value="3" />
<arg value="4" />
</java>
</jacoco:coverage>

<!-- "Error: arguments must be integers!" -->
<echo message="TEST RacingScore2: a b c" />
<jacoco:coverage destfile="${result.exec.file}">
<java classname="edu.nmsu.cs.scoring.RacingScore2" fork="true">
<classpath path="${build.dir}" />
<arg value="a" />
<arg value="b" />
<arg value="c" />
</java>
</jacoco:coverage>
</target>

<!-- generate a new jacoco report from a new data file; only runs if needed -->
<target name="jacocoreport" depends="jacocorun,checkReport" unless="report.notneeded">
<target name="report" depends="test,checkReport" unless="report.notneeded">
<echo>report needed...</echo>
<jacoco:report>
<executiondata>
<file file="jacoco.exec"/>
<file file="${result.exec.file}"/>
</executiondata>
<structure name="iglooscore">
<structure name="JaCoCo Ant Example">
<classfiles>
<fileset dir="."/>
<fileset dir="${build.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="."/>
<fileset dir="${src.dir}"/>
</sourcefiles>
</structure>
<html destdir="report"/>
<html destdir="${result.report.dir}"/>
<csv destfile="${result.report.dir}/report.csv"/>
<xml destfile="${result.report.dir}/report.xml"/>
</jacoco:report>
</target>

<!-- tests if new jacoco report needs generated by checking if top report file
(index.html) is newer than the run data file (jacoco.exec) -->
<target name="checkReport">
<uptodate property="report.notneeded" targetfile="${result.report.dir}/index.html" srcfile="${result.exec.file}" />
</target>

<!-- clean up by removing all generated files; do "ant clean" to start afresh -->
<target name="clean">
<delete>
<fileset dir="." includes="*.class jacoco.exec"/>
<fileset dir="." includes="**/*.class **/jacoco.exec"/>
</delete>
<delete dir="report" />
<delete dir="${result.report.dir}" />
</target>

</project>
Expand Down
2 changes: 1 addition & 1 deletion Coverage/src/edu/nmsu/cs/scoring/RacingScore2.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else if (score3 < score1 && score3 < score2)
public static void main(String args[])
{
int s1, s2, s3;
if (args == null || args.length != 3)
if (args.length != 3) // args wont ever be null
{
System.err.println("Error: must supply three arguments!");
return;
Expand Down
5 changes: 5 additions & 0 deletions HelloWorld/src/helloworld.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class helloworld {
public static void main (String[] args){
System.out.println("Hello World");
}
}
9 changes: 9 additions & 0 deletions Questions/p1Questions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Time to complete Assignment: 5.5 hours

Time it actually took:
Thought/Design: 2 hours
Programming: 5 hours
Debugging: 4 hours
Total: 10 hours

Accuracy of original estimate: 55%
9 changes: 9 additions & 0 deletions Questions/p2Questions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Time to complete Assignment: 2 hours

Time it actually took:
Thought/Design: 30 min
Programming: 1 hour
Debugging: 1 hours
Total: 2.5 hours

Accuracy of original estimate: 80%
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Programs
Base code for program assignments in Software Development (C S 371).

# GitHub userid for CS371 LAB
GitHub userid: meiland1

## Program 1 and Program 2
These assignments rely on the SimpleWebServer program. Each gets graded using tags in a cloned repository.

Expand Down
Loading