diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 01:29:51 -0400 |
---|---|---|
committer | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 01:29:51 -0400 |
commit | c48241614cf8ec19ca71db901be9b764ea494c63 (patch) | |
tree | 84ec7d639e5b54adfd9cc122913a71c91c1c875a | |
parent | 3f2b9430c2de4641fdb1126d3d4e1556de1504b6 (diff) | |
parent | 5952e7509cc3a73718d0393570d126fa0f60202f (diff) | |
download | cbt-c48241614cf8ec19ca71db901be9b764ea494c63.tar.gz cbt-c48241614cf8ec19ca71db901be9b764ea494c63.tar.bz2 cbt-c48241614cf8ec19ca71db901be9b764ea494c63.zip |
Merge pull request #115 from cvogt/linux-compat
Linux compat
-rw-r--r-- | DEVELOPER_GUIDE.txt | 1 | ||||
-rwxr-xr-x | cbt | 31 | ||||
-rw-r--r-- | circle.yml | 5 |
3 files changed, 24 insertions, 13 deletions
diff --git a/DEVELOPER_GUIDE.txt b/DEVELOPER_GUIDE.txt index 5869257..b878a72 100644 --- a/DEVELOPER_GUIDE.txt +++ b/DEVELOPER_GUIDE.txt @@ -38,3 +38,4 @@ We strongly suggest well polished PRs, but don't want to stall improvements by discussions about minor flaws. As long as the PR does not break anything and improves the product, we should merge it, polishing remaining things afterwards. +On OSX `brew install coreutils` to have gdate and get nanosecond timings during bash script. @@ -8,12 +8,27 @@ # - reduction of dependencies # - performance improvements -start_seconds=$(gdate +"%s") -start_nanos=1$(gdate +"%N") +seconds() { + date +"%s" +} + +nanos() { + n=$(date +"%N") + if [ "$n" = "N" ]; then + n=$(gdate +"%N" 2>/dev/null) + fi + if [ "$n" = "" ]; then + n="0" + fi + echo $n +} + +start_seconds=$(seconds) +start_nanos=1$(nanos) time_taken() { - i=$(( $(gdate +"%s") - start_seconds )) - n=$(( $(( 1$(gdate +"%N") - start_nanos )) / 1000000 )) + i=$(( $(seconds) - start_seconds )) + n=$(( $(( 1$(nanos) - start_nanos )) / 1000000 )) if [[ ( "$n" < 0 ) ]]; then i=$(( i-1 )) n=$(( n+1000 )) @@ -33,12 +48,8 @@ log () { shift done if [ $enabled -eq 0 ]; then - which gdate 2>&1 > /dev/null - gdate_installed=$? - if [ $gdate_installed -eq 0 ]; then - delta=$(time_taken) - echo "[$delta] $msg" 1>&2 - fi + delta=$(time_taken) + echo "[$delta] $msg" 1>&2 fi } @@ -5,12 +5,11 @@ machine: dependencies: cache_directories: - "cache" - - "nailgun_launcher/target" - - "stage1/target" - - "stage2/target" override: + - ./cbt compile -Dlog=all - ./cbt direct -Dlog=all - ./cbt -Dlog=all + - cd plugins/scalatest/ && ../../cbt compile -Dlog=all && cd ../../ test: override: |