test: added test descriptions and resources for manually testing different project setup methods

This commit is contained in:
mlangkabel
2018-08-28 11:13:05 +02:00
parent 0f5548f5f9
commit 1ba843fbec
64 changed files with 1156 additions and 0 deletions
@@ -0,0 +1,11 @@
MY_PATH=`dirname "$0"`
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/Bar.h
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,35 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> Empty C++ Source Group"
* Click "Next"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "validate include directives"
* Validate result: "All include directives are resolved"
* Click "Next"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "2"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,10 @@
#ifndef FOO_H
#define FOO_H
#include "FooBar.h"
class Bar : public FooBar
{
};
#endif // FOO_H
@@ -0,0 +1,10 @@
#ifndef BAR_H
#define BAR_H
#include "FooBar.h"
class Foo : public FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,8 @@
#ifndef FOO_BAR_H
#define FOO_BAR_H
class FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,9 @@
#include "Foo.h"
#include "Bar.h"
void test()
{
Foo foo;
Bar bar;
}
+17
View File
@@ -0,0 +1,17 @@
MY_PATH=`dirname "$0"`
MY_PATH="${MY_PATH//\\//}"
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
WORKING_COPY_SRC_PATH=$WORKING_COPY_PATH/src
CBD_PATH=$WORKING_COPY_PATH/Test.cbp
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
sed -i "s|<source_path>|${WORKING_COPY_SRC_PATH}|g" ${CBD_PATH}
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/include/Bar.h
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,34 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Compilation Database"
* Click "Next"
* Pick "./working_copy/Test.cbp" at "Compilation Database"
* Click "show source files" button
* Validate "Source Files" list contains "src/main.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "2"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6"/>
<Project>
<Option title="Test"/>
<Option makefile_is_custom="1"/>
<Option compiler="msvc8"/>
<Option virtualFolders="CMake Files\;"/>
<Build>
<Target title="all">
<Option working_dir="<source_path>"/>
<Option type="4"/>
<MakeCommands>
<Build command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 all"/>
<CompileFile command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 &quot;$file&quot;"/>
<Clean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
<DistClean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="Test">
<Option output="<source_path>/Test.exe" prefix_auto="0" extension_auto="0"/>
<Option working_dir="<source_path>"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="msvc8"/>
<Compiler>
<Add directory="<source_path>/include"/>
</Compiler>
<MakeCommands>
<Build command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 Test"/>
<CompileFile command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 &quot;$file&quot;"/>
<Clean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
<DistClean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="Test/fast">
<Option output="<source_path>/Test.exe" prefix_auto="0" extension_auto="0"/>
<Option working_dir="<source_path>"/>
<Option object_output="./"/>
<Option type="1"/>
<Option compiler="msvc8"/>
<Compiler>
<Add directory="<source_path>/include"/>
</Compiler>
<MakeCommands>
<Build command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 Test/fast"/>
<CompileFile command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 &quot;$file&quot;"/>
<Clean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
<DistClean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="edit_cache">
<Option working_dir="<source_path>"/>
<Option type="4"/>
<MakeCommands>
<Build command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 edit_cache"/>
<CompileFile command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 &quot;$file&quot;"/>
<Clean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
<DistClean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
</MakeCommands>
</Target>
<Target title="rebuild_cache">
<Option working_dir="<source_path>"/>
<Option type="4"/>
<MakeCommands>
<Build command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 rebuild_cache"/>
<CompileFile command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 &quot;$file&quot;"/>
<Clean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
<DistClean command="nmake /NOLOGO /f <source_path>\Makefile VERBOSE=1 clean"/>
</MakeCommands>
</Target>
</Build>
<Unit filename="<source_path>/main.cpp">
<Option target="Test"/>
</Unit>
<Unit filename="<source_path>/CMakeLists.txt">
<Option virtualFolder="CMake Files\"/>
</Unit>
</Project>
</CodeBlocks_project_file>
@@ -0,0 +1,10 @@
#ifndef FOO_H
#define FOO_H
#include "FooBar.h"
class Bar : public FooBar
{
};
#endif // FOO_H
@@ -0,0 +1,10 @@
#ifndef BAR_H
#define BAR_H
#include "FooBar.h"
class Foo : public FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,8 @@
#ifndef FOO_BAR_H
#define FOO_BAR_H
class FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,9 @@
#include "Foo.h"
#include "Bar.h"
void test()
{
Foo foo;
Bar bar;
}
+23
View File
@@ -0,0 +1,23 @@
MY_PATH=`dirname "$0"`
MY_PATH="${MY_PATH//\\//}"
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
WORKING_COPY_SRC_PATH=$WORKING_COPY_PATH/src
CDB_PATH=$WORKING_COPY_PATH/compile_commands.json
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "[" >> $CDB_PATH
echo " {" >> $CDB_PATH
echo " \"directory\": \"${WORKING_COPY_PATH}\"," >> $CDB_PATH
echo " \"command\": \"clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem \\\"${WORKING_COPY_SRC_PATH}/include\\\" -D _DEBUG -D _MT -D _DLL -D WIN32 -D _WINDOWS -D BUILD_TYPE=\\\"\\\" -D QT_WIDGETS_LIB -D QT_GUI_LIB -D QT_CORE_LIB -D QT_NETWORK_LIB -D QT_WINEXTRAS_LIB -D QT_SVG_LIB -D CMAKE_INTDIR=\\\"Debug\\\" -D _MBCS -std=c++14 \\\"${WORKING_COPY_SRC_PATH}/main.cpp\\\"\"" >> $CDB_PATH
echo " \"file\": \"${WORKING_COPY_SRC_PATH}/main.cpp\"" >> $CDB_PATH
echo " }" >> $CDB_PATH
echo "]" >> $CDB_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/include/Bar.h
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,34 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Compilation Database"
* Click "Next"
* Pick "./working_copy/compile_commands.json" at "Compilation Database"
* Click "show source files" button
* Validate "Source Files" list contains "src/main.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "2"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,10 @@
#ifndef FOO_H
#define FOO_H
#include "FooBar.h"
class Bar : public FooBar
{
};
#endif // FOO_H
@@ -0,0 +1,10 @@
#ifndef BAR_H
#define BAR_H
#include "FooBar.h"
class Foo : public FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,8 @@
#ifndef FOO_BAR_H
#define FOO_BAR_H
class FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,9 @@
#include "Foo.h"
#include "Bar.h"
void test()
{
Foo foo;
Bar bar;
}
@@ -0,0 +1,13 @@
MY_PATH=`dirname "$0"`
MY_PATH="${MY_PATH//\\//}"
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/Bar.h
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,33 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Sonargraph"
* Click "Next"
* Pick "./working_copy/Test.sonargraph/system.sonargraph" at "Compilation Database"
* Click "show source files" button
* Validate "Source Files" list contains "src/main.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "2"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,8 @@
<?xml version="1.0" ?>
<ns2:softwareSystem xmlns:ns2="http://www.hello2morrow.com/sonargraph/core" id="0c1ca5dfc52cd6e30960e06c4d5cb96a" version="9.8.1.519">
<description></description>
<module xmlns:ns4="http://www.hello2morrow.com/sonargraph/languageprovider/cplusplus" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:xsdCppManualModule" name="Test" id="24d0b2632bc424febb83b42d77e8eae5" language="CPlusPlus">
<description></description>
<rootPath name="."></rootPath>
</module>
</ns2:softwareSystem>
@@ -0,0 +1,10 @@
#ifndef FOO_H
#define FOO_H
#include "FooBar.h"
class Bar : public FooBar
{
};
#endif // FOO_H
@@ -0,0 +1,10 @@
#ifndef BAR_H
#define BAR_H
#include "FooBar.h"
class Foo : public FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,8 @@
#ifndef FOO_BAR_H
#define FOO_BAR_H
class FooBar
{
};
#endif // FOO_BAR_H
@@ -0,0 +1,9 @@
#include "Foo.h"
#include "Bar.h"
void test()
{
Foo foo;
Bar bar;
}
@@ -0,0 +1,11 @@
MY_PATH=`dirname "$0"`
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/foo/Bar.java
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,32 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Empty Java Source Group"
* Click "Next"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Add "**/Foo.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,5 @@
package foo;
class Bar implements FooBar
{
}
@@ -0,0 +1,5 @@
package foo;
class Foo implements FooBar
{
}
@@ -0,0 +1,5 @@
package foo;
public interface FooBar
{
}
@@ -0,0 +1,8 @@
package foo;
public class Main
{
public Foo m_foo;
public Bar m_bar;
}
@@ -0,0 +1,11 @@
MY_PATH=`dirname "$0"`
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/src/main/java/hello/Greeter.java
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,39 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Java Source Group from Gradle"
* Click "Next"
* Select "./working_copy/build.gradle" at "Gradle Project File"
* Click "show source files"
* Validate 2 files are listed
* Click "OK"
* Check "Sould Index Tests"
* Click "show source files"
* Validate 3 files are listed
* Click "OK"
* Click "Next"
* Add "**/HelloWorld.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Validate 2 files are listed for indexing
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,31 @@
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
mainClassName = 'hello.HelloWorld'
// tag::repositories[]
repositories {
mavenCentral()
}
// end::repositories[]
// tag::jar[]
jar {
baseName = 'gs-gradle'
version = '0.1.0'
}
// end::jar[]
// tag::dependencies[]
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile "joda-time:joda-time:2.2"
testCompile "junit:junit:4.12"
}
// end::dependencies[]
// tag::wrapper[]
// end::wrapper[]
@@ -0,0 +1,6 @@
#Thu Mar 01 09:01:25 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
+164
View File
@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+90
View File
@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@@ -0,0 +1,7 @@
package hello;
public class Greeter {
public String sayHello() {
return "Hello world!";
}
}
@@ -0,0 +1,13 @@
package hello;
import org.joda.time.LocalTime;
public class HelloWorld {
public static void main(String[] args) {
LocalTime currentTime = new LocalTime();
System.out.println("The current local time is: " + currentTime);
Greeter greeter = new Greeter();
System.out.println(greeter.sayHello());
}
}
@@ -0,0 +1,40 @@
package hello;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
public class HelloWorldTests {
private ByteArrayOutputStream baos = new ByteArrayOutputStream();
private PrintStream ps = new PrintStream(baos);
@Before
public void setup() {
System.setOut(ps);
}
@Test
public void shouldPrintTimeToConsole() {
HelloWorld.main(new String[] { });
assertThat(output(), containsString("The current local time is"));
}
@Test
public void shouldPrintHelloWorldToConsole() {
HelloWorld.main(new String[] { });
assertThat(output(), containsString("Hello world!"));
}
private String output() {
return new String(baos.toByteArray(), StandardCharsets.UTF_8);
}
}
@@ -0,0 +1,11 @@
MY_PATH=`dirname "$0"`
SRC_PATH=$MY_PATH/data
WORKING_COPY_PATH=$MY_PATH/working_copy
mkdir -p $WORKING_COPY_PATH
cp -ar $SRC_PATH/. $WORKING_COPY_PATH
echo "Setup Complete"
@@ -0,0 +1,9 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
echo "" >> $WORKING_COPY_PATH/my-app/src/main/java/com/mycompany/app/Bar.java
echo "Update Complete"
@@ -0,0 +1,8 @@
MY_PATH=`dirname "$0"`
WORKING_COPY_PATH=$MY_PATH/working_copy
rm -rf $WORKING_COPY_PATH
echo "Teardown Complete"
@@ -0,0 +1,39 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Java Source Group from Maven"
* Click "Next"
* Select "./working_copy/my-app/pom.xml" at "Maven Project File"
* Click "show source files"
* Validate 4 files are listed
* Click "OK"
* Check "Sould Index Tests"
* Click "show source files"
* Validate 5 files are listed
* Click "OK"
* Click "Next"
* Add "**/Foo.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Validate 4 files are listed for indexing
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,5 @@
package com.mycompany.app;
class Bar implements FooBar
{
}
@@ -0,0 +1,5 @@
package com.mycompany.app;
class Foo implements FooBar
{
}
@@ -0,0 +1,5 @@
package com.mycompany.app;
public interface FooBar
{
}
@@ -0,0 +1,13 @@
package com.mycompany.app;
public class Main
{
public Foo m_foo;
public Bar m_bar;
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
@@ -0,0 +1,38 @@
package com.mycompany.app;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}