From: fennecdjay Date: Mon, 23 Sep 2019 16:24:39 +0000 (+0200) Subject: :white_check_mark: Update tests X-Git-Tag: nightly~2212^2~4 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=caf5644f16eec472e649eb591a0f8bd23e78d3ba;p=gwion.git :white_check_mark: Update tests --- diff --git a/tests/import/specialid_emit.c b/tests/import/specialid_emit.c new file mode 100644 index 00000000..4069b078 --- /dev/null +++ b/tests/import/specialid_emit.c @@ -0,0 +1,26 @@ +#include "gwion_util.h" +#include "gwion_ast.h" +#include "oo.h" +#include "vm.h" +#include "env.h" +#include "type.h" +#include "object.h" +#include "instr.h" +#include "gwion.h" +#include "operator.h" +#include "import.h" +#include "emit.h" +#include "specialid.h" + + +static ID_EMIT(spidem) { + const Instr instr = emit_add_instr(emit, RegPushImm); + instr->m_val = 1234; + return instr; +} + +GWION_IMPORT(spid_test) { + struct SpecialId_ spid = { .type=t_int, .em=spidem, .is_const = 1 }; + gwi_specialid(gwi, "testid", &spid); + return GW_OK; +} diff --git a/tests/import/specialid_emit.gw b/tests/import/specialid_emit.gw new file mode 100644 index 00000000..ae200733 --- /dev/null +++ b/tests/import/specialid_emit.gw @@ -0,0 +1 @@ +<<< testid >>>; diff --git a/tests/sh/opt.sh b/tests/sh/opt.sh index 65c18796..d231dac6 100644 --- a/tests/sh/opt.sh +++ b/tests/sh/opt.sh @@ -1,5 +1,6 @@ #!/bin/bash -# [test] #16 +# [test] #17 + n=0 [ "$1" ] && n="$1" [ "$n" -eq 0 ] && n=1 @@ -72,6 +73,10 @@ run "$n" "Kompile time Konfig" "-k" "file" n=$((n+1)) run "$n" "just check" "-g check" "file" +# set compilation passes +n=$((n+1)) +run "$n" "just check" "-g nopass" "file" + # test signal ./gwion -l1 & PID=$! diff --git a/tests/sh/plugin.sh b/tests/sh/plugin.sh index 122110a7..55b0d43a 100644 --- a/tests/sh/plugin.sh +++ b/tests/sh/plugin.sh @@ -1,5 +1,5 @@ #!/bin/bash -# [test] #32 +# [test] #33 n=0 [ "$1" ] && n="$1"