refactor: Move all files to a src directory

This commit is contained in:
Jeremy Wall 2024-03-31 09:47:52 -04:00
parent 454d992599
commit 1717bb1185
10 changed files with 0 additions and 294 deletions

View File

@ -1,3 +0,0 @@
#!/bin/bash
rhino harness/rhino_harness.js

View File

@ -1,24 +0,0 @@
var path = 'lib';
var testpath = 'tests';
var libs = [
'Test/TAP.js',
'Test/TAP/Class.js',
'Test/TAP/Runner.js'
];
var tests = [
'01_tap.t.js',
];
for (i in libs) {
var lib = libs[i];
load(path+'/'+lib);
}
for (i in tests) {
var test = tests[i];
var script = readFile(testpath+'/'+test);
t = eval(script);
t.run_tests();
}

View File

@ -1,75 +0,0 @@
#!/bin/bash
usage()
{
cat << HELPMSG
Usage:
add this library to a javascript project for you
$0 -d <project path>
print this help
$0 -h
HELPMSG
}
while getopts "d:h" OPTION
do
case $OPTION in
d)
DIRNAME=$OPTARG
;;
h)
usage
exit 0
;;
?)
usage
exit 1
esac
done
MYDIR=$(dirname $0)
if [[ -z $DIRNAME ]]
then
echo "No -d option was present. You must provide a Project path.";
usage
exit 1
fi
echo "Setting up in project: ${DIRNAME}"
#set up the directory structure
if [[ ! -d $DIRNAME/ext ]]
then
echo Making ${DIRNAME}/ext
mkdir $DIRNAME/ext
fi
if [[ ! -d $DIRNAME/harness ]]
then
echo Making ${DIRNAME}/harness
mkdir $DIRNAME/harness
fi
if [[ ! -d $DIRNAME/t || -d $DIRNAME/tests ]]
then
echo Making ${DIRNAME}/t
mkdir $DIRNAME/t
fi
echo copy the files we need for initial setup
cp -r -f $MYDIR/../lib/Test $DIRNAME/ext/
if [[ -d $DIRNAME/t ]]
then
echo copying TapHarness.html to $DIRNAME/t/
cp -r -f $MYDIR/../tmpl/TapHarness.html $DIRNAME/t/
elif [[ -d tests ]]
then
echo copying TapHarness.html to $DIRNAME/tests/
cp -r -f $MYDIR/../tmpl/TapHarness.html $DIRNAME/tests/
fi
echo copying rhino harnesses to $DIRNAME/harness/
cp -r -f $MYDIR/../tmpl/*rhino* $DIRNAME/harness/

View File

@ -1,74 +0,0 @@
#!bash
usage()
{
cat << HELPMSG
Usage:
create a distribution directory with the specified version
$0 -d <dist directory> -v <version>
print this help
$0 -h
HELPMSG
}
while getopts ":d:v:h" OPTION
do
case $OPTION in
d)
DIRNAME=$OPTARG
;;
v)
VERSION=$OPTARG
;;
h)
usage
exit 1
;;
?)
usage
exit 1
;;
esac
done
if [[ -z $DIRNAME ]]
then
usage
exit 1
fi
if [[ -z $VERSION ]]
then
usage
exit 1
fi
DIST="$DIRNAME-$VERSION"
ROOT="$(dirname $0)/.."
LIB="${ROOT}/lib";
TLIB="${ROOT}/tests";
SCRIPTS="Test/TAP.js Test/TAP/Class.js Test/TAP/Runner.js";
if [[ ! -d $DIST ]]
then
mkdir $DIST
else
rm -rf $DIST
mkdir $DIST
fi
for s in $SCRIPTS
do
cat - $LIB/$s >> $DIST/test_tap.js <<FILEMSG
///////////////////////////////////////
///// ${s} Version:${VERSION}
///////////////////////////////////////
FILEMSG
done
cp $LIB/Test/TAPBrowser.js $DIST/TAPBrowserHarness.js
cp $TLIB/TapHarness.html $DIST/TapHarness.html
tar -czv -f $DIST.tar.gz $DIST
rm -rf $DIST

View File

@ -1,66 +0,0 @@
#! /bin/bash
usage()
{
cat << HELPMSG
Usage:
create a javascript test in the specified location
$0 -d <test directory> <test_name>
print this help
$0 -h
HELPMSG
}
while getopts ":d:h" OPTION
do
case $OPTION in
d)
DIRNAME=$OPTARG
;;
h)
usage
exit 1
;;
?)
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))
if [[ -z $DIRNAME ]]
then
echo 'Must provide a test directory'
usage
exit 1
fi
if [[ -z $1 ]]
then
echo 'Must provide a test name'
usage
exit 1
fi
TESTNAME=`echo $1 | tr '[:upper:]' '[:lower:]'`.t.js
cat > $DIRNAME/$TESTNAME << TEST
(function() {
var t = new Test.TAP.Class();
t.plan('no_plan');
t.setUp = function() {
};
t.testSomething = function() {
};
t.tearDown = function() {
};
return t;
})();
TEST

View File

@ -1,52 +0,0 @@
#!/bin/bash
usage()
{
cat << HELPMSG
Usage:
update this library in a javascript project for you
$0 -d <project path>
print this help
$0 -h
HELPMSG
}
while getopts "d:h" OPTION
do
case $OPTION in
d)
DIRNAME=$OPTARG
;;
h)
usage
exit 0
;;
?)
usage
exit 1
esac
done
MYDIR=$(dirname $0)
if [[ -z $DIRNAME ]]
then
echo "No -d option was present. You must provide a Project path.";
usage
exit 1
fi
echo "Setting up in project: ${DIRNAME}"
#set up the directory structure
if [[ ! -d $DIRNAME/ext ]]
then
mkdir $DIRNAME/ext
fi
echo copying the javascript test libraries
cp -r -f $MYDIR/../lib/Test $DIRNAME/ext/
#now go back to where we started
cd $WORKING