Skip to content

Commit

Permalink
added missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 15, 2013
1 parent 20dfaf5 commit 8fb7b54
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 0 deletions.
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "tracy/tracy",

This comment has been minimized.

Copy link
@JanTvrdik

JanTvrdik Mar 15, 2013

Contributor

Should be nette/tracy (same vendor as on GitHub).

This comment has been minimized.

Copy link
@Majkl578

Majkl578 Mar 15, 2013

Contributor

👍

This comment has been minimized.

Copy link
@fprochazka

fprochazka Mar 15, 2013

Contributor

👍

This comment has been minimized.

Copy link
@dg

dg Mar 15, 2013

Author Member

Common way on packagist is monolog/monolog (instead of Seldaek/monolog), twig/twig (instead of fabpot/Twig) etc.

This comment has been minimized.

Copy link
@dg

dg Mar 15, 2013

Author Member

BTW, I am thinking how to rename dg/texy to texy/texy and dg/dibi to dibi/dibi. Maybe using metapackage? Any ideas?

This comment has been minimized.

Copy link
@fprochazka

fprochazka Mar 15, 2013

Contributor

Yes, but that's a case, when the vendor would be a username. Vendor of this package is Nette Foundation.

This comment has been minimized.

Copy link
@fprochazka

fprochazka Mar 15, 2013

Contributor

I think the metapackage is a good choise, but packagist doesn't rename packages, they only delete them for you (you download counts will be lost). But they are preparing something for renaming. Not sure how far they are.

"type": "library",
"description": "Debugger for PHP",
"keywords": ["debug", "debugger", "nette"],
"homepage": "http://tracy.nette.org",
"license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
"authors": [
{
"name": "David Grudl",
"homepage": "http://davidgrudl.com"

This comment has been minimized.

Copy link
@Majkl578

Majkl578 Mar 15, 2013

Contributor

Why not Nette Community, same as Nette itself has?

}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"nette/tester": "@dev"
},
"autoload": {
"classmap": ["Tracy/"]

This comment has been minimized.

Copy link
@Majkl578

Majkl578 Mar 15, 2013

Contributor

Correct me if I'm wrong, but IMO Tracy itself follows PSR-0, so why classmap?

This comment has been minimized.

Copy link
@dg

dg Mar 15, 2013

Author Member

This is really not final version.

}
}
3 changes: 3 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*/output
/coverage.dat
/test.log
13 changes: 13 additions & 0 deletions tests/RunTests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@ECHO OFF

SET testRunner="%~dp0..\vendor\nette\tester\Tester\tester.php"

IF NOT EXIST %testRunner% (
ECHO Nette Tester is missing. You can install it using Composer:
ECHO php composer.phar update --dev
EXIT /B 2
)

SET phpIni="%~dp0php.ini-win"

php.exe -c %phpIni% %testRunner% -p php-cgi.exe -c %phpIni% -j 20 -log "%~dp0test.log" %*
26 changes: 26 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* Test initialization and helpers.
*
* @author David Grudl
* @package Nette\Test
*/


if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}


// configure environment
Tester\Helpers::setup();
class_alias('Tester\Assert', 'Assert');
date_default_timezone_set('Europe/Prague');


if (extension_loaded('xdebug')) {
xdebug_disable();
Tester\CodeCoverage\Collector::start(__DIR__ . '/coverage.dat');
}
5 changes: 5 additions & 0 deletions tests/php.ini-unix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[PHP]
;extension_dir = "./ext"

[Zend]
;zend_extension="./ext/zend_extension"
6 changes: 6 additions & 0 deletions tests/php.ini-win
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[PHP]
extension_dir = "./ext"
extension=php_mbstring.dll

[Zend]
;zend_extension="./ext/php_xdebug-2.0.5-5.3-vc6.dll"
40 changes: 40 additions & 0 deletions tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/sh

# Path to this script's directory
dir=$(cd `dirname $0` && pwd)

# Path to test runner script
runnerScript="$dir/../vendor/nette/tester/Tester/tester.php"
if [ ! -f "$runnerScript" ]; then
echo "Nette Tester is missing. You can install it using Composer:" >&2
echo "php composer.phar update --dev." >&2
exit 2
fi

# Path to php.ini if passed as argument option
phpIni=
while getopts ":c:" opt; do
case $opt in
c) phpIni="$OPTARG"
;;

:) echo "Missing argument for -$OPTARG option" >&2
exit 2
;;
esac
done

# Runs tests with script's arguments, add default php.ini if not specified
# Doubled -c option intentionally
if [ -n "$phpIni" ]; then
php -c "$phpIni" "$runnerScript" -j 20 "$@"
else
php -c "$dir/php.ini-unix" "$runnerScript" -j 20 -c "$dir/php.ini-unix" "$@"
fi
error=$?

# Print *.actual content if tests failed
if [ "${VERBOSE-false}" != "false" -a $error -ne 0 ]; then
for i in $(find . -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
exit $error
fi

5 comments on commit 8fb7b54

@dg
Copy link
Member Author

@dg dg commented on 8fb7b54 Mar 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the order of files and directories

tests
Tracy
vendor
composer.json

I mean Tracy after tests. Wouldn't it be better this way?

sources
    Tracy
tests
vendor
composer.json

Yes, it is detail ;)

@bauer01
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 maybe sources -> src ?

@dg
Copy link
Member Author

@dg dg commented on 8fb7b54 Mar 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The src is commonly used and sounds good in abbreviation like libs, www, app. But sources sounds better in names like tests, vendor, examples, composer…

@hrach
Copy link
Contributor

@hrach hrach commented on 8fb7b54 Mar 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src is pattern.

@rostenkowski
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with david's "sounding" args but also agree that the src is a pattern and that arg has for me bigger weight...

Please sign in to comment.