From 42a34d459e99c9e366e626e134d3e75e74e1f191 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 22 Aug 2020 14:14:05 +0000 Subject: Implementation of TIP 582: comments in expressions --- generic/tclCompExpr.c | 20 ++++++++++++++++++-- tests/compExpr.test | 36 ++++++++++++++++++++++++++++++++++++ tests/expr-old.test | 2 +- tests/expr.test | 34 ++++++++++++++++++++++++++++++++++ tests/parseExpr.test | 8 ++++++++ 5 files changed, 97 insertions(+), 3 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 74610c7..5c5a491 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -164,6 +164,8 @@ enum Marks { * "=" is encountered. */ #define INVALID 5 /* A parse error. Used when any punctuation * appears that's not a supported operator. */ +#define COMMENT 6 /* Comment. Lasts to end of line or end of + * expression, whichever comes first. */ /* Leaf lexemes */ @@ -462,7 +464,7 @@ static const unsigned char Lexeme[] = { INVALID /* FS */, INVALID /* GS */, INVALID /* RS */, INVALID /* US */, INVALID /* SPACE */, 0 /* ! or != */, - QUOTED /* " */, INVALID /* # */, + QUOTED /* " */, 0 /* # */, VARIABLE /* $ */, MOD /* % */, 0 /* & or && */, INVALID /* ' */, OPEN_PAREN /* ( */, CLOSE_PAREN /* ) */, @@ -708,6 +710,10 @@ ParseExpr( int b; switch (lexeme) { + case COMMENT: + start += scanned; + numBytes -= scanned; + continue; case INVALID: msg = Tcl_ObjPrintf("invalid character \"%.*s\"", scanned, start); @@ -1892,7 +1898,7 @@ ParseLexeme( storage, if non-NULL. */ { const char *end; - int scanned; + int scanned, size; Tcl_UniChar ch = 0; Tcl_Obj *literal = NULL; unsigned char byte; @@ -1907,6 +1913,16 @@ ParseLexeme( return 1; } switch (byte) { + case '#': + /* + * Scan forward over the comment contents. + */ + for (size = 0; byte != '\n' && byte != 0 && size < numBytes; size++) { + byte = UCHAR(start[size]); + } + *lexemePtr = COMMENT; + return size - (byte == '\n'); + case '*': if ((numBytes > 1) && (start[1] == '*')) { *lexemePtr = EXPON; diff --git a/tests/compExpr.test b/tests/compExpr.test index 3b44af8..8803f17 100644 --- a/tests/compExpr.test +++ b/tests/compExpr.test @@ -371,10 +371,46 @@ test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setu unset end i tmp rename getbytes {} } -result 0 + +proc extract {opcodes descriptor} { + set instructions [dict values [dict get $descriptor instructions]] + return [lmap i $instructions { + if {[lindex $i 0] in $opcodes} {string cat $i} else continue + }] +} + +test compExpr-8.1 {TIP 582: expression comments} -setup {} -body { + extract {loadStk add} [tcl::unsupported::getbytecode script {expr { + $abc + # + $def + + $ghi + }}] +} -result {loadStk loadStk add} +test compExpr-8.2 {TIP 582: expression comments} -setup {} -body { + extract {loadStk add} [tcl::unsupported::getbytecode script {expr { + $abc + # + $def + # + $ghi }}] +} -result loadStk +test compExpr-8.3 {TIP 582: expression comments} -setup {} -body { + extract {loadStk add} [tcl::unsupported::getbytecode script {expr { + $abc + # + $def\ + + $ghi + }}] +} -result loadStk +test compExpr-8.4 {TIP 582: expression comments} -setup {} -body { + extract {loadStk add} [tcl::unsupported::getbytecode script {expr { + $abc + # + $def\\ + + $ghi + }}] +} -result {loadStk loadStk add} # cleanup catch {unset a} catch {unset b} +catch {rename extract ""} ::tcltest::cleanupTests return diff --git a/tests/expr-old.test b/tests/expr-old.test index 003ee00..de10da0 100644 --- a/tests/expr-old.test +++ b/tests/expr-old.test @@ -522,7 +522,7 @@ test expr-old-26.10b {error conditions} ieeeFloatingPoint { list [catch {expr 2.0/0.0} msg] $msg } {0 Inf} test expr-old-26.11 {error conditions} -body { - expr 2# + expr 2` } -returnCodes error -match glob -result * test expr-old-26.12 {error conditions} -body { expr a.b diff --git a/tests/expr.test b/tests/expr.test index 632f1c4..ef00464 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -7384,6 +7384,40 @@ foreach v1 $values r1 $results { } } unset -nocomplain values results ctr + +test expr-62.1 {TIP 582: comments} -body { + expr {1 # + 2} +} -result 1 +test expr-62.2 {TIP 582: comments} -body { + expr "1 #\n+ 2" +} -result 3 +test expr-62.3 {TIP 582: comments} -setup { + set ctr 0 +} -body { + expr { + # This is a demonstration of a comment + 1 + 2 + 3 + # and another comment + + 4 + 5 + # + [incr ctr] + + [incr ctr] + } +} -result 16 +# Buggy because line breaks aren't tracked inside expressions at all +test expr-62.4 {TIP 582: comments don't hide line breaks} -setup { + proc getline {} { + dict get [info frame -1] line + } + set base [getline] +} -constraints knownBug -body { + expr { + 0 + # a comment + + [getline] - $base + } +} -cleanup { + rename getline "" +} -result 5 # cleanup unset -nocomplain a diff --git a/tests/parseExpr.test b/tests/parseExpr.test index 47dbec5..8ca5fca 100644 --- a/tests/parseExpr.test +++ b/tests/parseExpr.test @@ -1073,6 +1073,14 @@ test parseExpr-22.21 {Bug d2ffcca163} -constraints testexprparser -body { testexprparser in\u0433(0) -1 } -returnCodes error -match glob -result {missing operand*} +test parseExpr-23.1 {TIP 582: comments} -constraints testexprparser -body { + testexprparser "7 # * 8 " -1 +} -result {- {} 0 subexpr 7 1 text 7 0 {}} +test parseExpr-23.2 {TIP 582: comments} -constraints testexprparser -body { + testexprparser "7 #\n* 8 " -1 +} -result {- {} 0 subexpr {7 # +*} 5 operator # 0 subexpr 7 1 text 7 0 subexpr * 1 text * 0 {}} + # cleanup cleanupTests return -- cgit v0.12 From c76cad8a920e86cd3c255ed42e6f5b2bb727df1c Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 22 Aug 2020 14:24:31 +0000 Subject: Added documentation --- doc/expr.n | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/expr.n b/doc/expr.n index 1498ba1..25b0a84 100644 --- a/doc/expr.n +++ b/doc/expr.n @@ -41,6 +41,12 @@ When an expression evaluates to an integer, the value is the decimal form of the integer, and when an expression evaluates to a floating-point number, the value is the form produced by the \fB%g\fR format specifier of Tcl's \fBformat\fR command. +.PP +.VS "TIP 582" +You can use \fB#\fR at any point in the expression (except inside double +quotes or braces) to start a comment. Comments last to the end of the line or +the end of the expression, whichever comes first. +.VE "TIP 582" .SS OPERANDS .PP An expression consists of a combination of operands, operators, parentheses and @@ -487,7 +493,9 @@ value of true: .PP .CS set isTrue [\fBexpr\fR { + # Does the environment variable exist, and... [info exists ::env(SOME_ENV_VAR)] && + # ...does it contain a proper true value? [string is true -strict $::env(SOME_ENV_VAR)] }] .CE -- cgit v0.12 From 1192757fb71a5f28fa60aa3e5c23ac851adabc3e Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 24 Aug 2020 08:56:34 +0000 Subject: Added two test cases --- tests/expr.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/expr.test b/tests/expr.test index ef00464..41d028b 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -7418,6 +7418,17 @@ test expr-62.4 {TIP 582: comments don't hide line breaks} -setup { } -cleanup { rename getline "" } -result 5 +test expr-62.5 {TIP 582: comments don't splice tokens} { + set a False + expr {$a#don't splice +ne#don't splice +false} +} 1 +test expr-62.6 {TIP 582: comments don't splice tokens} { + expr {0x2#don't splice +ne#don't splice +2} +} 1 # cleanup unset -nocomplain a -- cgit v0.12 From fe94c1d6c4fa1c0d810d2eb6b845e7d0faf8812c Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 24 Aug 2020 13:31:00 +0000 Subject: Tricky case in function calls. --- generic/tclCompExpr.c | 33 ++++++++++++++++++++++++++++++--- tests/expr.test | 16 ++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 5c5a491..30ca876 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -676,9 +676,10 @@ ParseExpr( OpNode *newPtr = NULL; do { - if (size <= UINT_MAX/sizeof(OpNode)) { - newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode)); - } + if (size <= UINT_MAX/sizeof(OpNode)) { + newPtr = (OpNode *) attemptckrealloc(nodes, + size * sizeof(OpNode)); + } } while ((newPtr == NULL) && ((size -= (size - nodesUsed) / 2) > nodesUsed)); if (newPtr == NULL) { @@ -748,6 +749,32 @@ ParseExpr( } else if (Tcl_GetBooleanFromObj(NULL,literal,&b) == TCL_OK) { lexeme = BOOLEAN; } else { + /* + * Tricky case: see test expr-62.10 + */ + + int scanned2 = scanned; + do { + scanned2 += TclParseAllWhiteSpace( + start + scanned2, numBytes - scanned2); + scanned2 += ParseLexeme( + start + scanned2, numBytes - scanned2, &lexeme, + NULL); + } while (lexeme == COMMENT); + if (lexeme == OPEN_PAREN) { + /* + * Actually a function call, but with obscuring + * comments. Skip to the start of the parentheses. + * Note that we assume that open parentheses are one + * byte long. + */ + + lexeme = FUNCTION; + Tcl_ListObjAppendElement(NULL, funcList, literal); + scanned = scanned2 - 1; + break; + } + Tcl_DecrRefCount(literal); msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"", (scanned < limit) ? scanned : limit - 3, start, diff --git a/tests/expr.test b/tests/expr.test index 41d028b..4e8706f 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -7429,6 +7429,22 @@ test expr-62.6 {TIP 582: comments don't splice tokens} { ne#don't splice 2} } 1 +test expr-62.7 {TIP 582: comments can go inside function calls} { + expr {max(1,# comment + 2)} +} 2 +test expr-62.8 {TIP 582: comments can go inside function calls} { + expr {max(1# comment + ,2)} +} 2 +test expr-62.9 {TIP 582: comments can go inside function calls} { + expr {max(# comment + 1,2)} +} 2 +test expr-62.10 {TIP 582: comments can go inside function calls} { + expr {max# comment + (1,2)} +} 2 # cleanup unset -nocomplain a -- cgit v0.12 From 3c53be5e75cfe4cbca25b963b16a6a99229c6136 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Nov 2020 13:32:39 +0000 Subject: Correct casing of "packageName" argument in Tcl_StaticPackage() call and "load" command (which - actually - is not a packageName at all ...) UPDATE: I am moving this to a feature branch. Changing the arguments passed to Tcl_StaticPackage will be an incompatible break for any scripts currently searching the [info loaded] list for "dde" or "registry". Not a change we should put in a patchlevel without at least a ticket to record the explanation and a (POTENTIAL INCOMPATIBILITY) warning. --- tests/unload.test | 3 --- win/Makefile.in | 6 +++--- win/tclAppInit.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/unload.test b/tests/unload.test index 815ff31..32767fa 100644 --- a/tests/unload.test +++ b/tests/unload.test @@ -38,9 +38,6 @@ testConstraint $loaded [expr {![string match *pkgua* $alreadyLoaded]}] set alreadyTotalLoaded [info loaded] -# Certain tests require the 'teststaticpkg' command from tcltest -testConstraint teststaticpkg [llength [info commands teststaticpkg]] - # Certain tests need the 'testsimplefilsystem' in tcltest testConstraint testsimplefilesystem \ [llength [info commands testsimplefilesystem]] diff --git a/win/Makefile.in b/win/Makefile.in index cfa4163..f984114 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -155,9 +155,9 @@ REG_LIB_FILE = @LIBPREFIX@tclreg$(REGVER)${DLLSUFFIX}${LIBSUFFIX} TEST_DLL_FILE = tcltest$(VER)${DLLSUFFIX} TEST_EXE_FILE = tcltest${EXESUFFIX} TEST_LIB_FILE = @LIBPREFIX@tcltest$(VER)${DLLSUFFIX}${LIBSUFFIX} -TEST_LOAD_PRMS = package ifneeded dde 1.4.3 [list load [file normalize ${DDE_DLL_FILE}] dde];\ - package ifneeded registry 1.3.5 [list load [file normalize ${REG_DLL_FILE}] registry] -TEST_LOAD_FACILITIES = package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest];\ +TEST_LOAD_PRMS = package ifneeded dde 1.4.3 [list load [file normalize ${DDE_DLL_FILE}] Dde];\ + package ifneeded registry 1.3.5 [list load [file normalize ${REG_DLL_FILE}] Registry] +TEST_LOAD_FACILITIES = package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}]];\ $(TEST_LOAD_PRMS) ZLIB_DLL_FILE = zlib1.dll diff --git a/win/tclAppInit.c b/win/tclAppInit.c index f78f788..695099e 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -163,12 +163,12 @@ Tcl_AppInit( if (Registry_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "registry", Registry_Init, NULL); + Tcl_StaticPackage(interp, "Registry", Registry_Init, NULL); if (Dde_Init(interp) == TCL_ERROR) { return TCL_ERROR; } - Tcl_StaticPackage(interp, "dde", Dde_Init, Dde_SafeInit); + Tcl_StaticPackage(interp, "Dde", Dde_Init, Dde_SafeInit); #endif #ifdef TCL_TEST -- cgit v0.12 From 4404292972214f5a699f956595d5b66539e08fc6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Nov 2020 17:17:41 +0000 Subject: Add MSVC "StaticPackage" build to travis. Fix another bug in winDde.test which didn't account for statically loaded dde package. --- .travis.yml | 9 +++++++++ tests/winDde.test | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 72ecdaa..d2e3ca9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -216,6 +216,15 @@ jobs: script: - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test + - name: "Windows/MSVC/StaticPackage" + os: windows + compiler: cl + env: *vcenv + before_install: *vcpreinst + install: [] + script: + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test - name: "Windows/MSVC/Debug" os: windows compiler: cl diff --git a/tests/winDde.test b/tests/winDde.test index 2abfdd4..9b5fd9e 100644 --- a/tests/winDde.test +++ b/tests/winDde.test @@ -21,7 +21,7 @@ if {[testConstraint win]} { if {![catch { ::tcltest::loadTestedCommands set ::ddever [package require dde 1.4.3] - set ::ddelib [lindex [package ifneeded dde $::ddever] 1]}]} { + set ::ddelib [info loaded "" Dde]}]} { testConstraint dde 1 } } @@ -38,7 +38,7 @@ proc createChildProcess {ddeServerName args} { set f [open $::scriptName w+] puts $f [list set ddeServerName $ddeServerName] - puts $f [list load $::ddelib dde] + puts $f [list load $::ddelib Dde] puts $f { # DDE child server - # -- cgit v0.12 From f827fd2a9d59990ad0ccf254d27113fd9881fcfe Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 7 Nov 2020 14:14:17 +0000 Subject: Added basic github action starter --- .github/workflows/tcl-build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/tcl-build.yml diff --git a/.github/workflows/tcl-build.yml b/.github/workflows/tcl-build.yml new file mode 100644 index 0000000..55cf359 --- /dev/null +++ b/.github/workflows/tcl-build.yml @@ -0,0 +1,37 @@ +name: Build and Test +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Configure + working-directory: unix + run: | + mkdir "${HOME}/install dir" + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1) + - name: Build + working-directory: unix + run: | + make all + - name: Build Test Harness + working-directory: unix + run: | + make tcltest + - name: Run Tests + working-directory: unix + run: | + make test + - name: Test-Drive Installation + working-directory: unix + run: | + make install + - name: Create Distribution Package + working-directory: unix + run: | + make dist + - name: Convert Documentation to HTML + working-directory: unix + run: | + make html-tcl -- cgit v0.12 From 0b5664774359a9aebd22165854c5db88934d82e2 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 7 Nov 2020 14:21:15 +0000 Subject: Updated workflow name --- .github/workflows/tcl-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tcl-build.yml b/.github/workflows/tcl-build.yml index 55cf359..db46cfd 100644 --- a/.github/workflows/tcl-build.yml +++ b/.github/workflows/tcl-build.yml @@ -1,4 +1,4 @@ -name: Build and Test +name: Linux Build and Test on: [push] jobs: build: -- cgit v0.12 From ca9f2d62104259f445e4ef0931b86af6c64085f5 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 7 Nov 2020 14:29:06 +0000 Subject: Updated README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 242b3b1..a0050cd 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). [![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-branch)](https://travis-ci.org/tcltk/tcl) +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) ## Contents 1. [Introduction](#intro) -- cgit v0.12 From 81a445ad4644c9f44c21bf6ffa5620a5badf800a Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 8 Nov 2020 12:08:01 +0000 Subject: Updated arrangement --- .github/workflows/linux-build.yml | 37 +++++++++++++++++++++++++++++++++++++ README.md | 7 +++++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/linux-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000..db46cfd --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,37 @@ +name: Linux Build and Test +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Configure + working-directory: unix + run: | + mkdir "${HOME}/install dir" + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1) + - name: Build + working-directory: unix + run: | + make all + - name: Build Test Harness + working-directory: unix + run: | + make tcltest + - name: Run Tests + working-directory: unix + run: | + make test + - name: Test-Drive Installation + working-directory: unix + run: | + make install + - name: Create Distribution Package + working-directory: unix + run: | + make dist + - name: Convert Documentation to HTML + working-directory: unix + run: | + make html-tcl diff --git a/README.md b/README.md index a0050cd..c1b8a4a 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,11 @@ This is the **Tcl 8.7a4** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). -[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-branch)](https://travis-ci.org/tcltk/tcl) -[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) +8.6.10 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch) +
+8.7a4 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch) +
+9.0a0 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) ## Contents 1. [Introduction](#intro) -- cgit v0.12 From d4ef5a261ac2cfb5615683a4daad2e89a693f7d3 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 8 Nov 2020 13:34:03 +0000 Subject: Added experimental Windows CI build instructions --- .github/workflows/win-build.yml | 22 ++++++++++++++++++++++ .project | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/win-build.yml diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml new file mode 100644 index 0000000..652b34a --- /dev/null +++ b/.github/workflows/win-build.yml @@ -0,0 +1,22 @@ +name: Windows Build and Test +on: [push] +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Init MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Build + working-directory: win + run: | + nmake -f makefile.vc all + - name: Build Test Harness + working-directory: win + run: | + nmake -f makefile.vc tcltest + - name: Run Tests + working-directory: win + run: | + nmake -f makefile.vc test diff --git a/.project b/.project index eddd834..27fef70 100644 --- a/.project +++ b/.project @@ -5,7 +5,22 @@ + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature -- cgit v0.12 From 25c115b5a87b9cac777c4338a7e20a0d4f6e5d52 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 8 Nov 2020 13:38:20 +0000 Subject: Added badges to README --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c1b8a4a..56db098 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,17 @@ This is the **Tcl 8.7a4** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). -8.6.10 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch) +8.6.10 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
-8.7a4 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch) +8.7a4 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
-9.0a0 [![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) +9.0a2 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain) ## Contents 1. [Introduction](#intro) -- cgit v0.12 From 33955d69338c3d268bfe9e51aad0c276cf8a1f0a Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 9 Nov 2020 09:13:57 +0000 Subject: Copied build control files for Github Actions from 8.7 --- .github/workflows/linux-build.yml | 37 +++++++++++++++++++++++++++++++++++++ .github/workflows/win-build.yml | 22 ++++++++++++++++++++++ README.md | 12 +++++++++++- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linux-build.yml create mode 100644 .github/workflows/win-build.yml diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000..db46cfd --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,37 @@ +name: Linux Build and Test +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Configure + working-directory: unix + run: | + mkdir "${HOME}/install dir" + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1) + - name: Build + working-directory: unix + run: | + make all + - name: Build Test Harness + working-directory: unix + run: | + make tcltest + - name: Run Tests + working-directory: unix + run: | + make test + - name: Test-Drive Installation + working-directory: unix + run: | + make install + - name: Create Distribution Package + working-directory: unix + run: | + make dist + - name: Convert Documentation to HTML + working-directory: unix + run: | + make html-tcl diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml new file mode 100644 index 0000000..652b34a --- /dev/null +++ b/.github/workflows/win-build.yml @@ -0,0 +1,22 @@ +name: Windows Build and Test +on: [push] +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Init MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Build + working-directory: win + run: | + nmake -f makefile.vc all + - name: Build Test Harness + working-directory: win + run: | + nmake -f makefile.vc tcltest + - name: Run Tests + working-directory: win + run: | + nmake -f makefile.vc test diff --git a/README.md b/README.md index 3b192a5..25367ce 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,17 @@ This is the **Tcl 8.6.10** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). -[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-6-branch)](https://travis-ci.org/tcltk/tcl) +8.6.10 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch) +
+8.7a4 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch) +
+9.0a2 +[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain) +[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain) ## Contents 1. [Introduction](#intro) -- cgit v0.12