From 3264655356b72f27aa28e5fbd4ccb5a77a47efd3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 13 Feb 2019 18:20:05 +0000 Subject: [PATCH 1/3] Compare hps_0.h files --- differences/file.groovy | 12 ++++++++++++ differences/json.groovy | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 differences/file.groovy diff --git a/differences/file.groovy b/differences/file.groovy new file mode 100644 index 0000000..f5e93da --- /dev/null +++ b/differences/file.groovy @@ -0,0 +1,12 @@ +def comparefiles(importedfile, currentfile) { + if (isUnix()) { + sh """ + diff -c <"${importedfile}" <"${currentfile}" + """ + } + else { + error "Windows not currently supporting file comparison" + } +} + +return this; diff --git a/differences/json.groovy b/differences/json.groovy index 19b7cf6..5ac37f2 100644 --- a/differences/json.groovy +++ b/differences/json.groovy @@ -1,12 +1,10 @@ def comparefiles(importedjsonfile, currentjsonfile) { - env.IMPORTED_JSON="${importedjsonfile}" - env.CURRENT_JSON="${currentjsonfile}" if (isUnix()) { sh """ which jq if [ \$? -ne 0 ]; then exit 1; fi # jq -S sorts json output - diff -c <(jq -S . "${IMPORTED_JSON}") <(jq -S . "${CURRENT_JSON}") + diff -c <(jq -S . "${importedjsonfile}") <(jq -S . "${currentjsonfile}") """ } else { From 2013c582c73ae5adf5b1c0bc26da48963faac83a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 13 Feb 2019 19:01:59 +0000 Subject: [PATCH 2/3] Compare hps_0.h files --- differences/file.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/differences/file.groovy b/differences/file.groovy index f5e93da..dee78b9 100644 --- a/differences/file.groovy +++ b/differences/file.groovy @@ -1,7 +1,7 @@ def comparefiles(importedfile, currentfile) { if (isUnix()) { sh """ - diff -c <"${importedfile}" <"${currentfile}" + diff -c "${importedfile}" "${currentfile}" """ } else { From 06c096fc7c054611d8847394e52bf1916163633b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 13 Feb 2019 19:17:49 +0000 Subject: [PATCH 3/3] Compare hps_0.h files --- differences/file.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/differences/file.groovy b/differences/file.groovy index dee78b9..ab4102f 100644 --- a/differences/file.groovy +++ b/differences/file.groovy @@ -1,7 +1,11 @@ -def comparefiles(importedfile, currentfile) { +def comparefiles(importedfile, currentfile, boolean ignorewhitespace = true) { if (isUnix()) { + def wsparameter = "-w" + if (!ignorewhitespace) { + wsparameter = "" + } sh """ - diff -c "${importedfile}" "${currentfile}" + diff -c ${wsparameter} "${importedfile}" "${currentfile}" """ } else {